Skip to content

Commit 35a3cff

Browse files
committed
---
yaml --- r: 130735 b: refs/heads/master c: 1ee099d h: refs/heads/master i: 130733: 0f86f34 130731: 0e7a455 130727: 73455f1 130719: 70778b5 v: v3
1 parent 114d9ed commit 35a3cff

Some content is hidden

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

118 files changed

+2508
-2600
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 641b1980a4031f711099c5791653464f93c43ebf
2+
refs/heads/master: 1ee099da36f6ac647747806558e555c5fe8dcd12
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
55
refs/heads/try: a2473a89da106f7dd3be86e9d52fe23f43d5bfa5

trunk/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#
6666
# * `VERBOSE=1` - Print all commands. Use this to see what's going on.
6767
# * `RUSTFLAGS=...` - Add compiler flags to all `rustc` invocations
68+
# * `JEMALLOC_FLAGS=...` - Pass flags to jemalloc's configure script
6869
#
6970
# * `TESTNAME=...` - Specify the name of tests to run
7071
# * `CHECK_IGNORED=1` - Run normally-ignored tests

trunk/mk/main.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,19 @@ endif
9090
CFG_RUSTC_FLAGS := $(RUSTFLAGS)
9191
CFG_GCCISH_CFLAGS :=
9292
CFG_GCCISH_LINK_FLAGS :=
93+
CFG_JEMALLOC_FLAGS :=
9394

9495
ifdef CFG_DISABLE_OPTIMIZE
9596
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
9697
CFG_RUSTC_FLAGS +=
98+
CFG_JEMALLOC_FLAGS += --enable-debug
9799
else
98100
# The rtopt cfg turns off runtime sanity checks
99101
CFG_RUSTC_FLAGS += -O --cfg rtopt
100102
endif
101103

104+
CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)
105+
102106
ifdef CFG_DISABLE_DEBUG
103107
CFG_RUSTC_FLAGS += --cfg ndebug
104108
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG

trunk/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
301301
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
302302
@$$(call E, make: jemalloc)
303303
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
304-
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ \
304+
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ $(CFG_JEMALLOC_FLAGS) \
305305
--build=$(CFG_BUILD) --host=$(1) \
306306
CC="$$(CC_$(1))" \
307307
AR="$$(AR_$(1))" \

trunk/src/doc/rust.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,36 +3564,34 @@ let (a, b) = p;
35643564
assert!(b != "world");
35653565
~~~~
35663566

3567-
### Vector, Array, and Slice types
3567+
### Vector types
35683568

3569-
Rust has three different types for a list of items:
3569+
The vector type constructor represents a homogeneous array of values of a given type.
3570+
A vector has a fixed size.
3571+
(Operations like `vec.push` operate solely on owned vectors.)
3572+
A vector type can be annotated with a _definite_ size, such as `[int, ..10]`.
3573+
Such a definite-sized vector type is a first-class type, since its size is known statically.
3574+
A vector without such a size is said to be of _indefinite_ size,
3575+
and is therefore not a _first-class_ type.
3576+
An indefinite-size vector can only be instantiated through a pointer type,
3577+
such as `&[T]` or `Vec<T>`.
3578+
The kind of a vector type depends on the kind of its element type,
3579+
as with other simple structural types.
35703580

3571-
* `Vec<T>`, a 'vector'
3572-
* `[T ..N]`, an 'array'
3573-
* `&[T]`, a 'slice'.
3581+
Expressions producing vectors of definite size cannot be evaluated in a
3582+
context expecting a vector of indefinite size; one must copy the
3583+
definite-sized vector contents into a distinct vector of indefinite size.
35743584

3575-
A vector is a heap-allocated list of `T`. A vector has ownership over the data
3576-
inside of it. It is also able to grow and change in size. It's important to note
3577-
that `Vec<T>` is a library type, it's not actually part of the core language.
3585+
An example of a vector type and its use:
35783586

3579-
An array has a fixed size, and can be allocated on either the stack or the heap.
3580-
3581-
A slice is a 'view' into a vector or array. It doesn't own the data it points
3582-
to, it borrows it.
3583-
3584-
An example of each kind:
3585-
3586-
```{rust}
3587-
let vec: Vec<int> = vec![1, 2, 3];
3588-
let arr: [int, ..3] = [1, 2, 3];
3589-
let s: &[int] = vec.as_slice();
3590-
```
3591-
3592-
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
3593-
`vec!` macro is also part of the standard library, rather than the language.
3587+
~~~~
3588+
let v: &[int] = &[7, 5, 3];
3589+
let i: int = v[2];
3590+
assert!(i == 3);
3591+
~~~~
35943592

3595-
All in-bounds elements of vectors, arrays, and slices are always initialized,
3596-
and access to a vector, array, or slice is always bounds-checked.
3593+
All in-bounds elements of a vector are always initialized,
3594+
and access to a vector is always bounds-checked.
35973595

35983596
### Structure types
35993597

trunk/src/libcollections/vec.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,19 +1618,6 @@ pub struct MoveItems<T> {
16181618
iter: Items<'static, T>
16191619
}
16201620

1621-
impl<T> MoveItems<T> {
1622-
#[inline]
1623-
/// Drops all items that have not yet been moved and returns the empty vector.
1624-
pub fn unwrap(mut self) -> Vec<T> {
1625-
unsafe {
1626-
for _x in self { }
1627-
let MoveItems { allocation, cap, iter: _iter } = self;
1628-
mem::forget(self);
1629-
Vec { ptr: allocation, cap: cap, len: 0 }
1630-
}
1631-
}
1632-
}
1633-
16341621
impl<T> Iterator<T> for MoveItems<T> {
16351622
#[inline]
16361623
fn next<'a>(&'a mut self) -> Option<T> {
@@ -2029,18 +2016,6 @@ mod tests {
20292016
assert_eq!(vec.swap_remove(0), None);
20302017
}
20312018

2032-
#[test]
2033-
fn test_move_iter_unwrap() {
2034-
let mut vec: Vec<uint> = Vec::with_capacity(7);
2035-
vec.push(1);
2036-
vec.push(2);
2037-
let ptr = vec.as_ptr();
2038-
vec = vec.move_iter().unwrap();
2039-
assert_eq!(vec.as_ptr(), ptr);
2040-
assert_eq!(vec.capacity(), 7);
2041-
assert_eq!(vec.len(), 0);
2042-
}
2043-
20442019
#[bench]
20452020
fn bench_new(b: &mut Bencher) {
20462021
b.iter(|| {

trunk/src/libnative/io/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ pub fn read<T>(fd: sock_t,
959959
// wait for the socket to become readable again.
960960
let _guard = lock();
961961
match retry(|| read(deadline.is_some())) {
962-
-1 if util::wouldblock() => {}
962+
-1 if util::wouldblock() => { assert!(deadline.is_some()); }
963963
-1 => return Err(os::last_error()),
964964
n => { ret = n; break }
965965
}

trunk/src/librustc/back/link.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use util::ppaux;
2828
use util::sha2::{Digest, Sha256};
2929

3030
use std::char;
31+
use std::collections::HashSet;
3132
use std::io::{fs, TempDir, Command};
3233
use std::io;
3334
use std::mem;
@@ -569,7 +570,10 @@ fn link_binary_output(sess: &Session,
569570
fn archive_search_paths(sess: &Session) -> Vec<Path> {
570571
let mut rustpath = filesearch::rust_path();
571572
rustpath.push(sess.target_filesearch().get_lib_path());
572-
let mut search: Vec<Path> = sess.opts.addl_lib_search_paths.borrow().clone();
573+
// FIXME: Addl lib search paths are an unordered HashSet?
574+
// Shouldn't this search be done in some order?
575+
let addl_lib_paths: HashSet<Path> = sess.opts.addl_lib_search_paths.borrow().clone();
576+
let mut search: Vec<Path> = addl_lib_paths.move_iter().collect();
573577
search.push_all(rustpath.as_slice());
574578
return search;
575579
}
@@ -1015,12 +1019,6 @@ fn link_args(cmd: &mut Command,
10151019

10161020
// Mark all dynamic libraries and executables as compatible with ASLR
10171021
cmd.arg("-Wl,--dynamicbase");
1018-
1019-
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
1020-
// space available to x86 Windows binaries on x86_64.
1021-
if sess.targ_cfg.arch == abi::X86 {
1022-
cmd.arg("-Wl,--large-address-aware");
1023-
}
10241022
}
10251023

10261024
if sess.targ_cfg.os == abi::OsAndroid {

trunk/src/librustc/diagnostics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,5 @@ register_diagnostics!(
169169
E0157,
170170
E0158,
171171
E0159,
172-
E0160,
173-
E0161
172+
E0160
174173
)

trunk/src/librustc/driver/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use syntax::diagnostic::{ColorConfig, Auto, Always, Never};
3030
use syntax::parse;
3131
use syntax::parse::token::InternedString;
3232

33-
use std::collections::HashMap;
33+
use std::collections::{HashSet, HashMap};
3434
use getopts::{optopt, optmulti, optflag, optflagopt};
3535
use getopts;
3636
use std::cell::{RefCell};
@@ -76,7 +76,7 @@ pub struct Options {
7676
// This was mutable for rustpkg, which updates search paths based on the
7777
// parsed code. It remains mutable in case its replacements wants to use
7878
// this.
79-
pub addl_lib_search_paths: RefCell<Vec<Path>>,
79+
pub addl_lib_search_paths: RefCell<HashSet<Path>>,
8080
pub maybe_sysroot: Option<Path>,
8181
pub target_triple: String,
8282
// User-specified cfg meta items. The compiler itself will add additional
@@ -113,7 +113,7 @@ pub fn basic_options() -> Options {
113113
lint_opts: Vec::new(),
114114
describe_lints: false,
115115
output_types: Vec::new(),
116-
addl_lib_search_paths: RefCell::new(Vec::new()),
116+
addl_lib_search_paths: RefCell::new(HashSet::new()),
117117
maybe_sysroot: None,
118118
target_triple: driver::host_triple().to_string(),
119119
cfg: Vec::new(),

trunk/src/librustc/driver/driver.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use serialize::{json, Encodable};
3232

3333
use std::io;
3434
use std::io::fs;
35-
use arena::TypedArena;
3635
use syntax::ast;
3736
use syntax::attr;
3837
use syntax::attr::{AttrMetaMethods};
@@ -87,9 +86,8 @@ pub fn compile_input(sess: Session,
8786

8887
if stop_after_phase_2(&sess) { return; }
8988

90-
let type_arena = TypedArena::new();
9189
let analysis = phase_3_run_analysis_passes(sess, &expanded_crate,
92-
ast_map, &type_arena, id);
90+
ast_map, id);
9391
phase_save_analysis(&analysis.ty_cx.sess, &expanded_crate, &analysis, outdir);
9492
if stop_after_phase_3(&analysis.ty_cx.sess) { return; }
9593
let (tcx, trans) = phase_4_translate_to_llvm(expanded_crate, analysis);
@@ -301,11 +299,11 @@ pub fn phase_2_configure_and_expand(sess: &Session,
301299
Some((krate, map))
302300
}
303301

304-
pub struct CrateAnalysis<'tcx> {
302+
pub struct CrateAnalysis {
305303
pub exp_map2: middle::resolve::ExportMap2,
306304
pub exported_items: middle::privacy::ExportedItems,
307305
pub public_items: middle::privacy::PublicItems,
308-
pub ty_cx: ty::ctxt<'tcx>,
306+
pub ty_cx: ty::ctxt,
309307
pub reachable: NodeSet,
310308
pub name: String,
311309
}
@@ -314,11 +312,10 @@ pub struct CrateAnalysis<'tcx> {
314312
/// Run the resolution, typechecking, region checking and other
315313
/// miscellaneous analysis passes on the crate. Return various
316314
/// structures carrying the results of the analysis.
317-
pub fn phase_3_run_analysis_passes<'tcx>(sess: Session,
318-
krate: &ast::Crate,
319-
ast_map: syntax::ast_map::Map,
320-
type_arena: &'tcx TypedArena<ty::t_box_>,
321-
name: String) -> CrateAnalysis<'tcx> {
315+
pub fn phase_3_run_analysis_passes(sess: Session,
316+
krate: &ast::Crate,
317+
ast_map: syntax::ast_map::Map,
318+
name: String) -> CrateAnalysis {
322319
let time_passes = sess.time_passes();
323320

324321
time(time_passes, "external crate/lib resolution", (), |_|
@@ -365,7 +362,6 @@ pub fn phase_3_run_analysis_passes<'tcx>(sess: Session,
365362
stability::Index::build(krate));
366363

367364
let ty_cx = ty::mk_ctxt(sess,
368-
type_arena,
369365
def_map,
370366
named_region_map,
371367
ast_map,
@@ -408,9 +404,6 @@ pub fn phase_3_run_analysis_passes<'tcx>(sess: Session,
408404
time(time_passes, "borrow checking", (), |_|
409405
middle::borrowck::check_crate(&ty_cx, krate));
410406

411-
time(time_passes, "rvalue checking", (), |_|
412-
middle::check_rvalues::check_crate(&ty_cx, krate));
413-
414407
time(time_passes, "kind checking", (), |_|
415408
kind::check_crate(&ty_cx, krate));
416409

trunk/src/librustc/driver/pretty.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use graphviz as dot;
3333
use std::io::{mod, MemReader};
3434
use std::from_str::FromStr;
3535
use std::option;
36-
use arena::TypedArena;
36+
3737

3838
#[deriving(PartialEq, Show)]
3939
pub enum PpSourceMode {
@@ -114,9 +114,7 @@ impl PpSourceMode {
114114
}
115115
PpmTyped => {
116116
let ast_map = ast_map.expect("--pretty=typed missing ast_map");
117-
let type_arena = TypedArena::new();
118-
let analysis = driver::phase_3_run_analysis_passes(sess, krate, ast_map,
119-
&type_arena, id);
117+
let analysis = driver::phase_3_run_analysis_passes(sess, krate, ast_map, id);
120118
let annotation = TypedAnnotation { analysis: analysis };
121119
f(&annotation, payload)
122120
}
@@ -262,25 +260,25 @@ impl pprust::PpAnn for HygieneAnnotation {
262260
}
263261

264262

265-
struct TypedAnnotation<'tcx> {
266-
analysis: CrateAnalysis<'tcx>,
263+
struct TypedAnnotation {
264+
analysis: CrateAnalysis,
267265
}
268266

269-
impl<'tcx> PrinterSupport for TypedAnnotation<'tcx> {
267+
impl PrinterSupport for TypedAnnotation {
270268
fn pp_ann<'a>(&'a self) -> &'a pprust::PpAnn { self as &pprust::PpAnn }
271269
}
272270

273-
impl<'tcx> SessionCarrier for TypedAnnotation<'tcx> {
271+
impl SessionCarrier for TypedAnnotation {
274272
fn sess<'a>(&'a self) -> &'a Session { &self.analysis.ty_cx.sess }
275273
}
276274

277-
impl<'tcx> AstMapCarrier for TypedAnnotation<'tcx> {
275+
impl AstMapCarrier for TypedAnnotation {
278276
fn ast_map<'a>(&'a self) -> Option<&'a ast_map::Map> {
279277
Some(&self.analysis.ty_cx.map)
280278
}
281279
}
282280

283-
impl<'tcx> pprust::PpAnn for TypedAnnotation<'tcx> {
281+
impl pprust::PpAnn for TypedAnnotation {
284282
fn pre(&self,
285283
s: &mut pprust::State,
286284
node: pprust::AnnNode) -> io::IoResult<()> {
@@ -533,9 +531,8 @@ pub fn pretty_print_input(sess: Session,
533531
match code {
534532
Some(code) => {
535533
let variants = gather_flowgraph_variants(&sess);
536-
let type_arena = TypedArena::new();
537534
let analysis = driver::phase_3_run_analysis_passes(sess, &krate,
538-
ast_map, &type_arena, id);
535+
ast_map, id);
539536
print_flowgraph(variants, analysis, code, out)
540537
}
541538
None => {

trunk/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub mod middle {
8080
pub mod check_const;
8181
pub mod check_loop;
8282
pub mod check_match;
83-
pub mod check_rvalues;
8483
pub mod check_static;
8584
pub mod const_eval;
8685
pub mod dataflow;

trunk/src/librustc/lint/builtin.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ impl LintPass for TypeLimits {
340340
declare_lint!(CTYPES, Warn,
341341
"proper use of libc types in foreign modules")
342342

343-
struct CTypesVisitor<'a, 'tcx: 'a> {
344-
cx: &'a Context<'a, 'tcx>
343+
struct CTypesVisitor<'a> {
344+
cx: &'a Context<'a>
345345
}
346346

347-
impl<'a, 'tcx> CTypesVisitor<'a, 'tcx> {
347+
impl<'a> CTypesVisitor<'a> {
348348
fn check_def(&mut self, sp: Span, ty_id: ast::NodeId, path_id: ast::NodeId) {
349349
match self.cx.tcx.def_map.borrow().get_copy(&path_id) {
350350
def::DefPrimTy(ast::TyInt(ast::TyI)) => {
@@ -375,7 +375,7 @@ impl<'a, 'tcx> CTypesVisitor<'a, 'tcx> {
375375
}
376376
}
377377

378-
impl<'a, 'tcx> Visitor<()> for CTypesVisitor<'a, 'tcx> {
378+
impl<'a> Visitor<()> for CTypesVisitor<'a> {
379379
fn visit_ty(&mut self, ty: &ast::Ty, _: ()) {
380380
match ty.node {
381381
ast::TyPath(_, _, id) => self.check_def(ty.span, ty.id, id),
@@ -505,11 +505,11 @@ impl LintPass for HeapMemory {
505505
declare_lint!(RAW_POINTER_DERIVING, Warn,
506506
"uses of #[deriving] with raw pointers are rarely correct")
507507

508-
struct RawPtrDerivingVisitor<'a, 'tcx: 'a> {
509-
cx: &'a Context<'a, 'tcx>
508+
struct RawPtrDerivingVisitor<'a> {
509+
cx: &'a Context<'a>
510510
}
511511

512-
impl<'a, 'tcx> Visitor<()> for RawPtrDerivingVisitor<'a, 'tcx> {
512+
impl<'a> Visitor<()> for RawPtrDerivingVisitor<'a> {
513513
fn visit_ty(&mut self, ty: &ast::Ty, _: ()) {
514514
static MSG: &'static str = "use of `#[deriving]` with a raw pointer";
515515
match ty.node {

0 commit comments

Comments
 (0)