Skip to content

Commit 4c87fbe

Browse files
committed
---
yaml --- r: 90533 b: refs/heads/master c: f43402f h: refs/heads/master i: 90531: 530fc19 v: v3
1 parent 8dcfe02 commit 4c87fbe

File tree

43 files changed

+286
-698
lines changed

Some content is hidden

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

43 files changed

+286
-698
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: 4584acdf4c5824e020c738f0c89e86021ac531c0
2+
refs/heads/master: f43402fd66d22842978e952c548125db66b3491f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/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/foo#1.0"; // a full package ID for rustpkg
793+
extern mod foo = "some/where/rust-foo#foo:1.0"; // a full package ID for rustpkg
794794
~~~~
795795

796796
##### Use declarations

trunk/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 ToBytesConsume
69+
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
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 ToStrConsume
97+
syn keyword rustTrait ToStr IntoStr
9898
syn keyword rustTrait CopyableTuple ImmutableTuple
9999
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
100100
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8

trunk/src/libextra/bitv.rs

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

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

938939
use std::uint;

trunk/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::*;
410+
use super::{BTree, LeafElt};
411411

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

trunk/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-
struct Semaphore { priv sem: Sem<()> }
332+
pub struct Semaphore { priv sem: Sem<()> }
333333

334334

335335
impl Clone for Semaphore {

trunk/src/libextra/test.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ 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() {}
674673

675674
let test_a = TestDesc {
676675
name: StaticTestName("a"),
@@ -1296,8 +1295,6 @@ mod tests {
12961295
12971296
#[test]
12981297
pub fn filter_for_ignored_option() {
1299-
fn dummy() {}
1300-
13011298
// When we run ignored tests the test filter should filter out all the
13021299
// unignored tests and flip the ignore flag on the rest to false
13031300
@@ -1441,6 +1438,7 @@ mod tests {
14411438
assert_eq!(diff2.len(), 7);
14421439
}
14431440
1441+
#[test]
14441442
pub fn ratchet_test() {
14451443
14461444
let dpth = TempDir::new("test-ratchet").expect("missing test for ratchet");

trunk/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::*;
887+
use super::{TreeMap, TreeNode};
888888

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

trunk/src/libextra/uuid.rs

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

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

trunk/src/librustc/back/link.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,17 +728,10 @@ 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-
739731
let mut out_filenames = ~[];
740-
for output in outputs.move_iter() {
741-
let out_file = link_binary_output(sess, trans, output, obj_filename, out_filename, lm);
732+
for &output in sess.outputs.iter() {
733+
let out_file = link_binary_output(sess, trans, output, obj_filename,
734+
out_filename, lm);
742735
out_filenames.push(out_file);
743736
}
744737

trunk/src/librustc/driver/session.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,20 +405,25 @@ 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 }
408409
for output in options.outputs.iter() {
409410
match *output {
410411
OutputExecutable => {}
411412
OutputStaticlib | OutputDylib | OutputRlib => return true
412413
}
413414
}
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+
}
422427
let mut base = options.outputs.clone();
423428
let mut iter = crate.attrs.iter().filter_map(|a| {
424429
if "crate_type" == a.name() {

trunk/src/librustc/middle/dead.rs

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

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, _: ()) {
161+
fn visit_path(&mut self, path: &ast::Path, id: ast::NodeId, _: ()) {
171162
self.lookup_and_handle_definition(&id);
163+
visit::walk_path(self, path, ());
172164
}
173165

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

trunk/src/librustc/middle/resolve.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,11 +1258,16 @@ 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+
12611266
name_bindings.define_module(parent_link,
12621267
Some(def_id),
12631268
ImplModuleKind,
12641269
false,
1265-
true,
1270+
is_public,
12661271
sp);
12671272

12681273
ModuleReducedGraphParent(

trunk/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-
struct StatRecorder<'a> {
133+
pub struct StatRecorder<'a> {
134134
ccx: @mut CrateContext,
135135
name: &'a str,
136136
start: u64,

trunk/src/librustc/middle/typeck/astconv.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ 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+
285291
fn ast_mt_to_mt<AC:AstConv, RS:RegionScope>(
286292
this: &AC, rscope: &RS, mt: &ast::mt) -> ty::mt {
287293

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

305311
match a_seq_ty.ty.node {
306-
ast::ty_vec(ref mt) => {
307-
let mut mt = ast_mt_to_mt(this, rscope, mt);
312+
ast::ty_vec(ty) => {
313+
let mut mt = ast_ty_to_mt(this, rscope, ty);
308314
if a_seq_ty.mutbl == ast::MutMutable {
309315
mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl };
310316
}
@@ -394,14 +400,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
394400
mk_pointer(this, rscope, mt, ty::vstore_box,
395401
|tmt| ty::mk_box(tcx, tmt))
396402
}
397-
ast::ty_uniq(ref mt) => {
398-
mk_pointer(this, rscope, mt, ty::vstore_uniq,
403+
ast::ty_uniq(ty) => {
404+
let mt = ast::mt { ty: ty, mutbl: ast::MutImmutable };
405+
mk_pointer(this, rscope, &mt, ty::vstore_uniq,
399406
|tmt| ty::mk_uniq(tcx, tmt))
400407
}
401-
ast::ty_vec(ref mt) => {
408+
ast::ty_vec(ty) => {
402409
tcx.sess.span_err(ast_ty.span, "bare `[]` is not a type");
403410
// return /something/ so they can at least get more errors
404-
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, mt), ty::vstore_uniq)
411+
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), ty::vstore_uniq)
405412
}
406413
ast::ty_ptr(ref mt) => {
407414
ty::mk_ptr(tcx, ast_mt_to_mt(this, rscope, mt))
@@ -532,15 +539,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
532539
}
533540
}
534541
}
535-
ast::ty_fixed_length_vec(ref a_mt, e) => {
542+
ast::ty_fixed_length_vec(ty, e) => {
536543
match const_eval::eval_const_expr_partial(&tcx, e) {
537544
Ok(ref r) => {
538545
match *r {
539546
const_eval::const_int(i) =>
540-
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
547+
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
541548
ty::vstore_fixed(i as uint)),
542549
const_eval::const_uint(i) =>
543-
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
550+
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
544551
ty::vstore_fixed(i as uint)),
545552
_ => {
546553
tcx.sess.span_fatal(

trunk/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(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()),
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()),
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),

trunk/src/librustdoc/fold.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ pub trait DocFolder {
2424
let inner = inner;
2525
let c = |x| self.fold_item(x);
2626
let inner = match inner {
27-
StructItem(i) => {
28-
let mut i = i;
27+
StructItem(mut i) => {
2928
let mut foo = ~[]; swap(&mut foo, &mut i.fields);
3029
let num_fields = foo.len();
3130
i.fields.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
@@ -35,15 +34,14 @@ pub trait DocFolder {
3534
ModuleItem(i) => {
3635
ModuleItem(self.fold_mod(i))
3736
},
38-
EnumItem(i) => {
39-
let mut i = i;
37+
EnumItem(mut i) => {
4038
let mut foo = ~[]; swap(&mut foo, &mut i.variants);
4139
let num_variants = foo.len();
4240
i.variants.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
4341
i.variants_stripped |= num_variants != i.variants.len();
4442
EnumItem(i)
4543
},
46-
TraitItem(i) => {
44+
TraitItem(mut i) => {
4745
fn vtrm<T: DocFolder>(this: &mut T, trm: TraitMethod) -> Option<TraitMethod> {
4846
match trm {
4947
Required(it) => {
@@ -60,22 +58,19 @@ pub trait DocFolder {
6058
},
6159
}
6260
}
63-
let mut i = i;
6461
let mut foo = ~[]; swap(&mut foo, &mut i.methods);
6562
i.methods.extend(&mut foo.move_iter().filter_map(|x| vtrm(self, x)));
6663
TraitItem(i)
6764
},
68-
ImplItem(i) => {
69-
let mut i = i;
65+
ImplItem(mut i) => {
7066
let mut foo = ~[]; swap(&mut foo, &mut i.methods);
7167
i.methods.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
7268
ImplItem(i)
7369
},
7470
VariantItem(i) => {
7571
let i2 = i.clone(); // this clone is small
7672
match i.kind {
77-
StructVariant(j) => {
78-
let mut j = j;
73+
StructVariant(mut j) => {
7974
let mut foo = ~[]; swap(&mut foo, &mut j.fields);
8075
let num_fields = foo.len();
8176
j.fields.extend(&mut foo.move_iter().filter_map(c));

trunk/src/librustdoc/html/render.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,13 @@ impl Context {
648648
self.root_path.push_str("../");
649649
self.current.push(s);
650650

651+
info!("Recursing into {}", self.dst.display());
652+
651653
mkdir(&self.dst);
652654
let ret = f(self);
653655

656+
info!("Recursed; leaving {}", self.dst.display());
657+
654658
// Go back to where we were at
655659
self.dst = prev;
656660
let len = self.root_path.len();
@@ -674,23 +678,18 @@ impl Context {
674678
// using a rwarc makes this parallelizable in the future
675679
local_data::set(cache_key, Arc::new(cache));
676680

677-
let mut work = ~[item];
678-
while work.len() > 0 {
679-
let item = work.pop();
680-
self.item(item, |_cx, item| {
681-
work.push(item);
682-
})
683-
}
681+
self.item(item);
684682
}
685683

686684
/// Non-parellelized version of rendering an item. This will take the input
687685
/// item, render its contents, and then invoke the specified closure with
688686
/// all sub-items which need to be rendered.
689687
///
690688
/// The rendering driver uses this closure to queue up more work.
691-
fn item(&mut self, item: clean::Item, f: |&mut Context, clean::Item|) {
689+
fn item(&mut self, item: clean::Item) {
692690
fn render(w: io::File, cx: &mut Context, it: &clean::Item,
693691
pushname: bool) {
692+
info!("Rendering an item to {}", w.path().display());
694693
// A little unfortunate that this is done like this, but it sure
695694
// does make formatting *a lot* nicer.
696695
local_data::set(current_location_key, cx.current.clone());
@@ -734,7 +733,7 @@ impl Context {
734733
};
735734
this.sidebar = build_sidebar(&m);
736735
for item in m.items.move_iter() {
737-
f(this, item);
736+
this.item(item);
738737
}
739738
})
740739
}
@@ -1203,7 +1202,7 @@ fn item_enum(w: &mut Writer, it: &clean::Item, e: &clean::Enum) {
12031202
VisSpace(it.visibility),
12041203
it.name.get_ref().as_slice(),
12051204
e.generics);
1206-
if e.variants.len() == 0 {
1205+
if e.variants.len() == 0 && !e.variants_stripped {
12071206
write!(w, " \\{\\}");
12081207
} else {
12091208
write!(w, " \\{\n");

trunk/src/librustuv/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
337337
EACCES => PermissionDenied,
338338
ECONNREFUSED => ConnectionRefused,
339339
ECONNRESET => ConnectionReset,
340+
ENOENT => FileNotFound,
340341
ENOTCONN => NotConnected,
341342
EPIPE => BrokenPipe,
342343
ECONNABORTED => ConnectionAborted,

0 commit comments

Comments
 (0)