Skip to content

Commit 0ce9732

Browse files
committed
---
yaml --- r: 119203 b: refs/heads/dist-snap c: 2a2d0dc h: refs/heads/master i: 119201: 4c51760 119199: b33ec98 v: v3
1 parent 4267c21 commit 0ce9732

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+716
-1231
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 0875ffcbfff1b8b432ae09dd435466f34e2c61fa
9+
refs/heads/dist-snap: 2a2d0dce87d8d2d77a1266a3b255b04651f36fe2
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/compiletest/procsrv.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@ use std::str;
1313
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
1414

1515
#[cfg(target_os = "win32")]
16-
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
17-
18-
let mut env = os::env();
16+
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
17+
let env = os::env();
1918

2019
// Make sure we include the aux directory in the path
2120
assert!(prog.ends_with(".exe"));
2221
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
2322

24-
env = env.map(|pair| {
25-
let (k,v) = (*pair).clone();
26-
if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
27-
else { (k,v) }
28-
});
23+
let mut new_env: Vec<_> = env.move_iter().map(|(k, v)| {
24+
let new_v = if "PATH" == k {
25+
format!("{};{};{}", v, lib_path, aux_path)
26+
} else {
27+
v
28+
};
29+
(k, new_v)
30+
}).collect();
2931
if prog.ends_with("rustc.exe") {
30-
env.push((~"RUST_THREADS", ~"1"));
32+
new_env.push((~"RUST_THREADS", ~"1"));
3133
}
32-
return env;
34+
return new_env;
3335
}
3436

3537
#[cfg(target_os = "linux")]

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
529529
c
530530
}
531531
} ).collect();
532-
str::from_chars( c )
532+
str::from_chars(c.as_slice())
533533
}
534534
535535
#[cfg(target_os = "win32")]

branches/dist-snap/src/doc/tutorial.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ references, or types where the only contained references
21072107
have the `'static` lifetime. (For more on named lifetimes and their uses,
21082108
see the [references and lifetimes guide][lifetimes].)
21092109
2110-
> ***Note:*** These two traits were referred to as 'kinds' in earlier
2110+
> ***Note:*** These built-in traits were referred to as 'kinds' in earlier
21112111
> iterations of the language, and often still are.
21122112
21132113
Additionally, the `Drop` trait is used to define destructors. This
@@ -2600,8 +2600,6 @@ As you can see, your module hierarchy is now three modules deep: There is the cr
26002600
function, and the module `farm`. The module `farm` also contains two functions and a third module `barn`,
26012601
which contains a function `hay`.
26022602

2603-
(In case you already stumbled over `extern crate`: It isn't directly related to a bare `mod`, we'll get to it later. )
2604-
26052603
## Paths and visibility
26062604

26072605
We've now defined a nice module hierarchy. But how do we access the items in it from our `main` function?
@@ -2843,11 +2841,11 @@ use farm::cow;
28432841

28442842
The path you give to `use` is per default global, meaning relative to the crate root,
28452843
no matter how deep the module hierarchy is, or whether the module body it's written in
2846-
is contained in its own file (remember: files are irrelevant).
2844+
is contained in its own file. (Remember: files are irrelevant.)
28472845

2848-
This is different to other languages, where you often only find a single import construct that combines the semantic
2846+
This is different from other languages, where you often only find a single import construct that combines the semantic
28492847
of `mod foo;` and `use`-statements, and which tend to work relative to the source file or use an absolute file path
2850-
- Rubys `require` or C/C++'s `#include` come to mind.
2848+
- Ruby's `require` or C/C++'s `#include` come to mind.
28512849

28522850
However, it's also possible to import things relative to the module of the `use`-statement:
28532851
Adding a `super::` in front of the path will start in the parent module,
@@ -3027,7 +3025,7 @@ The nested `barn` module is private, but the `pub use` allows users
30273025
of the module `farm` to access a function from `barn` without needing
30283026
to know that `barn` exists.
30293027

3030-
In other words, you can use them to decouple an public api from their internal implementation.
3028+
In other words, you can use it to decouple a public api from its internal implementation.
30313029

30323030
## Using libraries
30333031

@@ -3050,7 +3048,6 @@ fn main() {
30503048
}
30513049
~~~
30523050

3053-
Despite its name, `extern crate` is a distinct construct from regular `mod` declarations:
30543051
A statement of the form `extern crate foo;` will cause `rustc` to search for the crate `foo`,
30553052
and if it finds a matching binary it lets you use it from inside your crate.
30563053

branches/dist-snap/src/etc/emacs/rust-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@
196196
;; Special types
197197
(,(regexp-opt rust-special-types 'words) . font-lock-type-face)
198198

199-
;; Attributes like `#[bar(baz)]`
200-
(,(rust-re-grab (concat "#\\[" rust-re-ident "[^]]*\\]"))
199+
;; Attributes like `#[bar(baz)]` or `#![bar(baz)]`
200+
(,(rust-re-grab (concat "#\\!?[" rust-re-ident "[^]]*\\]"))
201201
1 font-lock-preprocessor-face)
202202

203203
;; Syntax extension invocations like `foo!`, highlight including the !

branches/dist-snap/src/libarena/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -23,8 +23,6 @@
2323
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2424
html_root_url = "http://static.rust-lang.org/doc/master")]
2525
#![allow(missing_doc)]
26-
#![feature(managed_boxes)]
27-
2826
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
2927

3028
extern crate collections;
@@ -301,7 +299,7 @@ fn test_arena_destructors() {
301299
for i in range(0u, 10) {
302300
// Arena allocate something with drop glue to make sure it
303301
// doesn't leak.
304-
arena.alloc(|| @i);
302+
arena.alloc(|| Rc::new(i));
305303
// Allocate something with funny size and alignment, to keep
306304
// things interesting.
307305
arena.alloc(|| [0u8, 1u8, 2u8]);
@@ -316,13 +314,13 @@ fn test_arena_destructors_fail() {
316314
for i in range(0u, 10) {
317315
// Arena allocate something with drop glue to make sure it
318316
// doesn't leak.
319-
arena.alloc(|| { @i });
317+
arena.alloc(|| { Rc::new(i) });
320318
// Allocate something with funny size and alignment, to keep
321319
// things interesting.
322320
arena.alloc(|| { [0u8, 1u8, 2u8] });
323321
}
324322
// Now, fail while allocating
325-
arena.alloc::<@int>(|| {
323+
arena.alloc::<Rc<int>>(|| {
326324
// Now fail.
327325
fail!();
328326
});

branches/dist-snap/src/librand/distributions/exponential.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
2828
/// Generate Normal Random
2929
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
3030
/// College, Oxford
31-
pub struct Exp1(f64);
31+
pub struct Exp1(pub f64);
3232

3333
// This could be done via `-rng.gen::<f64>().ln()` but that is slower.
3434
impl Rand for Exp1 {

branches/dist-snap/src/librand/distributions/normal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
2727
/// Generate Normal Random
2828
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
2929
/// College, Oxford
30-
pub struct StandardNormal(f64);
30+
pub struct StandardNormal(pub f64);
3131

3232
impl Rand for StandardNormal {
3333
fn rand<R:Rng>(rng: &mut R) -> StandardNormal {

branches/dist-snap/src/librand/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ pub fn random<T: Rand>() -> T {
666666
/// let Open01(val) = random::<Open01<f32>>();
667667
/// println!("f32 from (0,1): {}", val);
668668
/// ```
669-
pub struct Open01<F>(F);
669+
pub struct Open01<F>(pub F);
670670

671671
/// A wrapper for generating floating point numbers uniformly in the
672672
/// closed interval `[0,1]` (including both endpoints).
@@ -682,7 +682,7 @@ pub struct Open01<F>(F);
682682
/// let Closed01(val) = random::<Closed01<f32>>();
683683
/// println!("f32 from [0,1]: {}", val);
684684
/// ```
685-
pub struct Closed01<F>(F);
685+
pub struct Closed01<F>(pub F);
686686

687687
#[cfg(test)]
688688
mod test {

branches/dist-snap/src/librustc/front/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn fold_foreign_mod(cx: &mut Context, nm: &ast::ForeignMod) -> ast::ForeignMod {
9090
filter_view_item(cx, a).map(|x| cx.fold_view_item(x))
9191
}).collect();
9292
ast::ForeignMod {
93-
abis: nm.abis,
93+
abi: nm.abi,
9494
view_items: filtered_view_items,
9595
items: filtered_items
9696
}

branches/dist-snap/src/librustc/lib/llvm.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,6 @@ pub mod llvm {
14381438
-> Bool;
14391439
/** Moves the section iterator to point to the next section. */
14401440
pub fn LLVMMoveToNextSection(SI: SectionIteratorRef);
1441-
/** Returns the current section name. */
1442-
pub fn LLVMGetSectionName(SI: SectionIteratorRef) -> *c_char;
14431441
/** Returns the current section size. */
14441442
pub fn LLVMGetSectionSize(SI: SectionIteratorRef) -> c_ulonglong;
14451443
/** Returns the current section contents as a string buffer. */
@@ -1784,6 +1782,9 @@ pub mod llvm {
17841782

17851783
pub fn LLVMRustSetDLLExportStorageClass(V: ValueRef);
17861784
pub fn LLVMVersionMinor() -> c_int;
1785+
1786+
pub fn LLVMRustGetSectionName(SI: SectionIteratorRef,
1787+
data: *mut *c_char) -> c_int;
17871788
}
17881789
}
17891790

branches/dist-snap/src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn extract_crate_info(e: &Env, i: &ast::ViewItem) -> Option<CrateInfo> {
187187
fn visit_item(e: &Env, i: &ast::Item) {
188188
match i.node {
189189
ast::ItemForeignMod(ref fm) => {
190-
if fm.abis.is_rust() || fm.abis.is_intrinsic() {
190+
if fm.abi == abi::Rust || fm.abi == abi::RustIntrinsic {
191191
return;
192192
}
193193

branches/dist-snap/src/librustc/metadata/csearch.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,11 @@ pub fn get_exported_macros(cstore: &cstore::CStore,
290290
let cdata = cstore.get_crate_data(crate_num);
291291
decoder::get_exported_macros(cdata)
292292
}
293+
294+
pub fn get_tuple_struct_definition_if_ctor(cstore: &cstore::CStore,
295+
def_id: ast::DefId)
296+
-> Option<ast::DefId>
297+
{
298+
let cdata = cstore.get_crate_data(def_id.krate);
299+
decoder::get_tuple_struct_definition_if_ctor(cdata, def_id.node)
300+
}

branches/dist-snap/src/librustc/metadata/decoder.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,23 +929,26 @@ pub fn get_static_methods_if_impl(intr: Rc<IdentInterner>,
929929
/// If node_id is the constructor of a tuple struct, retrieve the NodeId of
930930
/// the actual type definition, otherwise, return None
931931
pub fn get_tuple_struct_definition_if_ctor(cdata: Cmd,
932-
node_id: ast::NodeId) -> Option<ast::NodeId> {
932+
node_id: ast::NodeId)
933+
-> Option<ast::DefId>
934+
{
933935
let item = lookup_item(node_id, cdata.data());
934936
let mut ret = None;
935937
reader::tagged_docs(item, tag_items_data_item_is_tuple_struct_ctor, |_| {
936938
ret = Some(item_reqd_and_translated_parent_item(cdata.cnum, item));
937939
false
938940
});
939-
ret.map(|x| x.node)
941+
ret
940942
}
941943

942944
pub fn get_item_attrs(cdata: Cmd,
943-
node_id: ast::NodeId,
945+
orig_node_id: ast::NodeId,
944946
f: |Vec<@ast::MetaItem> |) {
945947
// The attributes for a tuple struct are attached to the definition, not the ctor;
946948
// we assume that someone passing in a tuple struct ctor is actually wanting to
947949
// look at the definition
948-
let node_id = get_tuple_struct_definition_if_ctor(cdata, node_id).unwrap_or(node_id);
950+
let node_id = get_tuple_struct_definition_if_ctor(cdata, orig_node_id);
951+
let node_id = node_id.map(|x| x.node).unwrap_or(orig_node_id);
949952
let item = lookup_item(node_id, cdata.data());
950953
reader::tagged_docs(item, tag_attributes, |attributes| {
951954
reader::tagged_docs(attributes, tag_attribute, |attribute| {

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use std::hash::Hash;
3333
use std::io::MemWriter;
3434
use std::str;
3535
use collections::HashMap;
36-
use syntax::abi::AbiSet;
36+
use syntax::abi;
3737
use syntax::ast::*;
3838
use syntax::ast;
3939
use syntax::ast_map::{PathElem, PathElems};
@@ -1217,7 +1217,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
12171217
nitem: &ForeignItem,
12181218
index: @RefCell<Vec<entry<i64>> >,
12191219
path: PathElems,
1220-
abi: AbiSet) {
1220+
abi: abi::Abi) {
12211221
index.borrow_mut().push(entry {
12221222
val: nitem.id as i64,
12231223
pos: ebml_w.writer.tell().unwrap(),
@@ -1231,7 +1231,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
12311231
encode_bounds_and_type(ebml_w, ecx,
12321232
&lookup_item_type(ecx.tcx,local_def(nitem.id)));
12331233
encode_name(ebml_w, nitem.ident.name);
1234-
if abi.is_intrinsic() {
1234+
if abi == abi::RustIntrinsic {
12351235
(ecx.encode_inlined_item)(ecx, ebml_w, IIForeignRef(nitem));
12361236
} else {
12371237
encode_symbol(ecx, ebml_w, nitem.id);
@@ -1279,11 +1279,11 @@ fn my_visit_foreign_item(ni: &ForeignItem,
12791279
let mut ebml_w = unsafe {
12801280
ebml_w.unsafe_clone()
12811281
};
1282-
let abis = ecx.tcx.map.get_foreign_abis(ni.id);
1282+
let abi = ecx.tcx.map.get_foreign_abi(ni.id);
12831283
ecx.tcx.map.with_path(ni.id, |path| {
12841284
encode_info_for_foreign_item(ecx, &mut ebml_w,
12851285
ni, index,
1286-
path, abis);
1286+
path, abi);
12871287
});
12881288
}
12891289

branches/dist-snap/src/librustc/metadata/loader.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ use std::cast;
2929
use std::cmp;
3030
use std::io;
3131
use std::os::consts::{macos, freebsd, linux, android, win32};
32+
use std::ptr;
3233
use std::rc::Rc;
33-
use std::str;
3434
use std::slice;
35+
use std::str;
3536

3637
use collections::{HashMap, HashSet};
3738
use flate;
@@ -439,8 +440,9 @@ fn get_metadata_section_imp(os: Os, filename: &Path) -> Result<MetadataBlob, ~st
439440
};
440441
let si = mk_section_iter(of.llof);
441442
while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False {
442-
let name_buf = llvm::LLVMGetSectionName(si.llsi);
443-
let name = str::raw::from_c_str(name_buf);
443+
let mut name_buf = ptr::null();
444+
let name_len = llvm::LLVMRustGetSectionName(si.llsi, &mut name_buf);
445+
let name = str::raw::from_buf_len(name_buf as *u8, name_len as uint);
444446
debug!("get_metadata_section: name {}", name);
445447
if read_meta_section_name(os) == name {
446448
let cbuf = llvm::LLVMGetSectionContents(si.llsi);

branches/dist-snap/src/librustc/metadata/tydecode.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use middle::ty;
2020

2121
use std::str;
2222
use std::uint;
23-
use syntax::abi::AbiSet;
2423
use syntax::abi;
2524
use syntax::ast;
2625
use syntax::ast::*;
@@ -460,18 +459,12 @@ fn parse_purity(c: char) -> Purity {
460459
}
461460
}
462461

463-
fn parse_abi_set(st: &mut PState) -> AbiSet {
462+
fn parse_abi_set(st: &mut PState) -> abi::Abi {
464463
assert_eq!(next(st), '[');
465-
let mut abis = AbiSet::empty();
466-
while peek(st) != ']' {
467-
scan(st, |c| c == ',', |bytes| {
468-
let abi_str = str::from_utf8(bytes).unwrap().to_owned();
469-
let abi = abi::lookup(abi_str).expect(abi_str);
470-
abis.add(abi);
471-
});
472-
}
473-
assert_eq!(next(st), ']');
474-
return abis;
464+
scan(st, |c| c == ']', |bytes| {
465+
let abi_str = str::from_utf8(bytes).unwrap().to_owned();
466+
abi::lookup(abi_str).expect(abi_str)
467+
})
475468
}
476469

477470
fn parse_onceness(c: char) -> ast::Onceness {
@@ -505,7 +498,7 @@ fn parse_bare_fn_ty(st: &mut PState, conv: conv_did) -> ty::BareFnTy {
505498
let sig = parse_sig(st, |x,y| conv(x,y));
506499
ty::BareFnTy {
507500
purity: purity,
508-
abis: abi,
501+
abi: abi,
509502
sig: sig
510503
}
511504
}

0 commit comments

Comments
 (0)