Skip to content

Commit 84b000a

Browse files
committed
---
yaml --- r: 147319 b: refs/heads/try2 c: 4584acd h: refs/heads/master i: 147317: a3afa7c 147315: 3ca7a89 147311: 34b115c v: v3
1 parent fe7db4f commit 84b000a

File tree

44 files changed

+700
-288
lines changed

Some content is hidden

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

44 files changed

+700
-288
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1fee5cd953837d77bf3bcaaf9dcb4b869ae39090
8+
refs/heads/try2: 4584acdf4c5824e020c738f0c89e86021ac531c0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ extern mod extra; // equivalent to: extern mod extra = "extra";
790790
791791
extern mod rustextra = "extra"; // linking to 'extra' under another name
792792
793-
extern mod foo = "some/where/rust-foo#foo:1.0"; // a full package ID for rustpkg
793+
extern mod foo = "some/where/foo#1.0"; // a full package ID for rustpkg
794794
~~~~
795795

796796
##### Use declarations

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ syn keyword rustEnumVariant Ok Err
6666

6767
" Types and traits {{{3
6868
syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
69-
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
69+
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
7070
syn keyword rustTrait Bool
7171
syn keyword rustTrait ToCStr
7272
syn keyword rustTrait Char
@@ -94,7 +94,7 @@ syn keyword rustTrait Buffer Writer Reader Seek
9494
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9595
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9696
syn keyword rustTrait IterBytes
97-
syn keyword rustTrait ToStr IntoStr
97+
syn keyword rustTrait ToStr ToStrConsume
9898
syn keyword rustTrait CopyableTuple ImmutableTuple
9999
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
100100
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8

branches/try2/src/libextra/bitv.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,7 @@ impl<'a> Iterator<uint> for BitvSetIterator<'a> {
932932
mod tests {
933933
use extra::test::BenchHarness;
934934

935-
use bitv::{Bitv, SmallBitv, BigBitv, BitvSet, from_bools, from_fn,
936-
from_bytes};
935+
use bitv::*;
937936
use bitv;
938937

939938
use std::uint;

branches/try2/src/libextra/btree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BranchElt<K, V> {
407407
#[cfg(test)]
408408
mod test_btree{
409409

410-
use super::{BTree, LeafElt};
410+
use super::*;
411411

412412
///Tests the functionality of the add methods (which are unfinished).
413413
#[test]

branches/try2/src/libextra/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl Sem<~[WaitQueue]> {
329329
****************************************************************************/
330330

331331
/// A counting, blocking, bounded-waiting semaphore.
332-
pub struct Semaphore { priv sem: Sem<()> }
332+
struct Semaphore { priv sem: Sem<()> }
333333

334334

335335
impl Clone for Semaphore {

branches/try2/src/libextra/test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ fn should_sort_failures_before_printing_them() {
670670
use std::io::Decorator;
671671
use std::io::mem::MemWriter;
672672
use std::str;
673+
fn dummy() {}
673674

674675
let test_a = TestDesc {
675676
name: StaticTestName("a"),
@@ -1295,6 +1296,8 @@ mod tests {
12951296
12961297
#[test]
12971298
pub fn filter_for_ignored_option() {
1299+
fn dummy() {}
1300+
12981301
// When we run ignored tests the test filter should filter out all the
12991302
// unignored tests and flip the ignore flag on the rest to false
13001303
@@ -1438,7 +1441,6 @@ mod tests {
14381441
assert_eq!(diff2.len(), 7);
14391442
}
14401443
1441-
#[test]
14421444
pub fn ratchet_test() {
14431445
14441446
let dpth = TempDir::new("test-ratchet").expect("missing test for ratchet");

branches/try2/src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ impl<T: TotalOrd> Extendable<T> for TreeSet<T> {
884884
#[cfg(test)]
885885
mod test_treemap {
886886

887-
use super::{TreeMap, TreeNode};
887+
use super::*;
888888

889889
use std::rand::Rng;
890890
use std::rand;

branches/try2/src/libextra/uuid.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ impl Uuid {
219219
}
220220

221221
let mut uuid = Uuid{ bytes: [0, .. 16] };
222-
vec::bytes::copy_memory(uuid.bytes, b);
222+
unsafe {
223+
vec::raw::copy_memory(uuid.bytes, b);
224+
}
223225
Some(uuid)
224226
}
225227

branches/try2/src/librustc/back/link.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,17 @@ pub fn link_binary(sess: Session,
728728
obj_filename: &Path,
729729
out_filename: &Path,
730730
lm: &LinkMeta) -> ~[Path] {
731+
// If we're generating a test executable, then ignore all other output
732+
// styles at all other locations
733+
let outputs = if sess.opts.test {
734+
~[session::OutputExecutable]
735+
} else {
736+
(*sess.outputs).clone()
737+
};
738+
731739
let mut out_filenames = ~[];
732-
for &output in sess.outputs.iter() {
733-
let out_file = link_binary_output(sess, trans, output, obj_filename,
734-
out_filename, lm);
740+
for output in outputs.move_iter() {
741+
let out_file = link_binary_output(sess, trans, output, obj_filename, out_filename, lm);
735742
out_filenames.push(out_file);
736743
}
737744

branches/try2/src/librustc/driver/session.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,25 +405,20 @@ pub fn expect<T:Clone>(sess: Session, opt: Option<T>, msg: || -> ~str) -> T {
405405
}
406406

407407
pub fn building_library(options: &options, crate: &ast::Crate) -> bool {
408-
if options.test { return false }
409408
for output in options.outputs.iter() {
410409
match *output {
411410
OutputExecutable => {}
412411
OutputStaticlib | OutputDylib | OutputRlib => return true
413412
}
414413
}
414+
if options.test { return false }
415415
match syntax::attr::first_attr_value_str_by_name(crate.attrs, "crate_type") {
416416
Some(s) => "lib" == s || "rlib" == s || "dylib" == s || "staticlib" == s,
417417
_ => false
418418
}
419419
}
420420

421421
pub fn collect_outputs(options: &options, crate: &ast::Crate) -> ~[OutputStyle] {
422-
// If we're generating a test executable, then ignore all other output
423-
// styles at all other locations
424-
if options.test {
425-
return ~[OutputExecutable];
426-
}
427422
let mut base = options.outputs.clone();
428423
let mut iter = crate.attrs.iter().filter_map(|a| {
429424
if "crate_type" == a.name() {

branches/try2/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<'a> CheckLoanCtxt<'a> {
238238
self.bccx.loan_path_to_str(new_loan.loan_path)));
239239
self.bccx.span_note(
240240
old_loan.span,
241-
format!("second borrow of `{}` as mutable occurs here",
241+
format!("previous borrow of `{}` as mutable occurs here",
242242
self.bccx.loan_path_to_str(new_loan.loan_path)));
243243
return false;
244244
}
@@ -253,7 +253,7 @@ impl<'a> CheckLoanCtxt<'a> {
253253
self.bccx.mut_to_str(old_loan.mutbl)));
254254
self.bccx.span_note(
255255
old_loan.span,
256-
format!("second borrow of `{}` occurs here",
256+
format!("previous borrow of `{}` occurs here",
257257
self.bccx.loan_path_to_str(new_loan.loan_path)));
258258
return false;
259259
}

branches/try2/src/librustc/middle/dead.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,17 @@ impl Visitor<()> for MarkSymbolVisitor {
158158
visit::walk_expr(self, expr, ())
159159
}
160160

161-
fn visit_path(&mut self, path: &ast::Path, id: ast::NodeId, _: ()) {
161+
fn visit_ty(&mut self, typ: &ast::Ty, _: ()) {
162+
match typ.node {
163+
ast::ty_path(_, _, ref id) => {
164+
self.lookup_and_handle_definition(id);
165+
}
166+
_ => visit::walk_ty(self, typ, ()),
167+
}
168+
}
169+
170+
fn visit_path(&mut self, _: &ast::Path, id: ast::NodeId, _: ()) {
162171
self.lookup_and_handle_definition(&id);
163-
visit::walk_path(self, path, ());
164172
}
165173

166174
fn visit_item(&mut self, _item: @ast::item, _: ()) {

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,16 +1258,11 @@ impl Resolver {
12581258
let parent_link =
12591259
self.get_parent_link(new_parent, ident);
12601260
let def_id = local_def(item.id);
1261-
let ns = TypeNS;
1262-
let is_public =
1263-
!name_bindings.defined_in_namespace(ns) ||
1264-
name_bindings.defined_in_public_namespace(ns);
1265-
12661261
name_bindings.define_module(parent_link,
12671262
Some(def_id),
12681263
ImplModuleKind,
12691264
false,
1270-
is_public,
1265+
true,
12711266
sp);
12721267

12731268
ModuleReducedGraphParent(

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
130130
_InsnCtxt { _x: () }
131131
}
132132

133-
pub struct StatRecorder<'a> {
133+
struct StatRecorder<'a> {
134134
ccx: @mut CrateContext,
135135
name: &'a str,
136136
start: u64,

branches/try2/src/librustc/middle/typeck/astconv.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,6 @@ pub static NO_TPS: uint = 2;
282282
pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
283283
this: &AC, rscope: &RS, ast_ty: &ast::Ty) -> ty::t {
284284

285-
fn ast_ty_to_mt<AC:AstConv, RS:RegionScope>(
286-
this: &AC, rscope: &RS, ty: &ast::Ty) -> ty::mt {
287-
288-
ty::mt {ty: ast_ty_to_ty(this, rscope, ty), mutbl: ast::MutImmutable}
289-
}
290-
291285
fn ast_mt_to_mt<AC:AstConv, RS:RegionScope>(
292286
this: &AC, rscope: &RS, mt: &ast::mt) -> ty::mt {
293287

@@ -309,8 +303,8 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
309303
debug!("mk_pointer(vst={:?})", vst);
310304

311305
match a_seq_ty.ty.node {
312-
ast::ty_vec(ty) => {
313-
let mut mt = ast_ty_to_mt(this, rscope, ty);
306+
ast::ty_vec(ref mt) => {
307+
let mut mt = ast_mt_to_mt(this, rscope, mt);
314308
if a_seq_ty.mutbl == ast::MutMutable {
315309
mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl };
316310
}
@@ -400,15 +394,14 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
400394
mk_pointer(this, rscope, mt, ty::vstore_box,
401395
|tmt| ty::mk_box(tcx, tmt))
402396
}
403-
ast::ty_uniq(ty) => {
404-
let mt = ast::mt { ty: ty, mutbl: ast::MutImmutable };
405-
mk_pointer(this, rscope, &mt, ty::vstore_uniq,
397+
ast::ty_uniq(ref mt) => {
398+
mk_pointer(this, rscope, mt, ty::vstore_uniq,
406399
|tmt| ty::mk_uniq(tcx, tmt))
407400
}
408-
ast::ty_vec(ty) => {
401+
ast::ty_vec(ref mt) => {
409402
tcx.sess.span_err(ast_ty.span, "bare `[]` is not a type");
410403
// return /something/ so they can at least get more errors
411-
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), ty::vstore_uniq)
404+
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, mt), ty::vstore_uniq)
412405
}
413406
ast::ty_ptr(ref mt) => {
414407
ty::mk_ptr(tcx, ast_mt_to_mt(this, rscope, mt))
@@ -539,15 +532,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
539532
}
540533
}
541534
}
542-
ast::ty_fixed_length_vec(ty, e) => {
535+
ast::ty_fixed_length_vec(ref a_mt, e) => {
543536
match const_eval::eval_const_expr_partial(&tcx, e) {
544537
Ok(ref r) => {
545538
match *r {
546539
const_eval::const_int(i) =>
547-
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
540+
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
548541
ty::vstore_fixed(i as uint)),
549542
const_eval::const_uint(i) =>
550-
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
543+
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
551544
ty::vstore_fixed(i as uint)),
552545
_ => {
553546
tcx.sess.span_fatal(

branches/try2/src/librustdoc/clean.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,10 @@ impl Clean<Type> for ast::Ty {
621621
BorrowedRef {lifetime: l.clean(), mutability: m.mutbl.clean(),
622622
type_: ~m.ty.clean()},
623623
ty_box(ref m) => Managed(m.mutbl.clean(), ~m.ty.clean()),
624-
ty_uniq(ty) => Unique(~ty.clean()),
625-
ty_vec(ty) => Vector(~ty.clean()),
626-
ty_fixed_length_vec(ty, ref e) => FixedVector(~ty.clean(),
627-
e.span.to_src()),
624+
ty_uniq(ref m) => Unique(~m.ty.clean()),
625+
ty_vec(ref m) => Vector(~m.ty.clean()),
626+
ty_fixed_length_vec(ref m, ref e) => FixedVector(~m.ty.clean(),
627+
e.span.to_src()),
628628
ty_tup(ref tys) => Tuple(tys.iter().map(|x| x.clean()).collect()),
629629
ty_path(ref p, ref tpbs, id) =>
630630
resolve_type(p.clean(), tpbs.clean(), id),

branches/try2/src/librustdoc/fold.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ pub trait DocFolder {
2424
let inner = inner;
2525
let c = |x| self.fold_item(x);
2626
let inner = match inner {
27-
StructItem(mut i) => {
27+
StructItem(i) => {
28+
let mut i = i;
2829
let mut foo = ~[]; swap(&mut foo, &mut i.fields);
2930
let num_fields = foo.len();
3031
i.fields.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
@@ -34,14 +35,15 @@ pub trait DocFolder {
3435
ModuleItem(i) => {
3536
ModuleItem(self.fold_mod(i))
3637
},
37-
EnumItem(mut i) => {
38+
EnumItem(i) => {
39+
let mut i = i;
3840
let mut foo = ~[]; swap(&mut foo, &mut i.variants);
3941
let num_variants = foo.len();
4042
i.variants.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
4143
i.variants_stripped |= num_variants != i.variants.len();
4244
EnumItem(i)
4345
},
44-
TraitItem(mut i) => {
46+
TraitItem(i) => {
4547
fn vtrm<T: DocFolder>(this: &mut T, trm: TraitMethod) -> Option<TraitMethod> {
4648
match trm {
4749
Required(it) => {
@@ -58,19 +60,22 @@ pub trait DocFolder {
5860
},
5961
}
6062
}
63+
let mut i = i;
6164
let mut foo = ~[]; swap(&mut foo, &mut i.methods);
6265
i.methods.extend(&mut foo.move_iter().filter_map(|x| vtrm(self, x)));
6366
TraitItem(i)
6467
},
65-
ImplItem(mut i) => {
68+
ImplItem(i) => {
69+
let mut i = i;
6670
let mut foo = ~[]; swap(&mut foo, &mut i.methods);
6771
i.methods.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
6872
ImplItem(i)
6973
},
7074
VariantItem(i) => {
7175
let i2 = i.clone(); // this clone is small
7276
match i.kind {
73-
StructVariant(mut j) => {
77+
StructVariant(j) => {
78+
let mut j = j;
7479
let mut foo = ~[]; swap(&mut foo, &mut j.fields);
7580
let num_fields = foo.len();
7681
j.fields.extend(&mut foo.move_iter().filter_map(c));

0 commit comments

Comments
 (0)