Skip to content

Commit 3ca7a89

Browse files
committed
---
yaml --- r: 147315 b: refs/heads/try2 c: eabf11b h: refs/heads/master i: 147313: a550a47 147311: 34b115c v: v3
1 parent 3a13a02 commit 3ca7a89

File tree

29 files changed

+519
-62
lines changed

29 files changed

+519
-62
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: ac137f6dbe51429de203ea2e900b8bac01f466cb
8+
refs/heads/try2: eabf11b9cb1f1bddeb1208e5564e592d10e4b680
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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: 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;

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::*;
410+
use super::{BTree, LeafElt};
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-
struct Semaphore { priv sem: Sem<()> }
332+
pub struct Semaphore { priv sem: Sem<()> }
333333

334334

335335
impl Clone for Semaphore {

branches/try2/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");

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

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

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/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: 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(

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

branches/try2/src/librustdoc/html/render.rs

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

651-
info!("Recursing into {}", self.dst.display());
652-
653651
mkdir(&self.dst);
654652
let ret = f(self);
655653

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

681-
self.item(item);
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+
}
682684
}
683685

684686
/// Non-parellelized version of rendering an item. This will take the input
685687
/// item, render its contents, and then invoke the specified closure with
686688
/// all sub-items which need to be rendered.
687689
///
688690
/// The rendering driver uses this closure to queue up more work.
689-
fn item(&mut self, item: clean::Item) {
691+
fn item(&mut self, item: clean::Item, f: |&mut Context, clean::Item|) {
690692
fn render(w: io::File, cx: &mut Context, it: &clean::Item,
691693
pushname: bool) {
692-
info!("Rendering an item to {}", w.path().display());
693694
// A little unfortunate that this is done like this, but it sure
694695
// does make formatting *a lot* nicer.
695696
local_data::set(current_location_key, cx.current.clone());
@@ -733,7 +734,7 @@ impl Context {
733734
};
734735
this.sidebar = build_sidebar(&m);
735736
for item in m.items.move_iter() {
736-
this.item(item);
737+
f(this, item);
737738
}
738739
})
739740
}

branches/try2/src/librustuv/lib.rs

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

branches/try2/src/librustuv/uvll.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub static EOF: c_int = -4095;
4444
pub static UNKNOWN: c_int = -4094;
4545

4646
// uv-errno.h redefines error codes for windows, but not for unix...
47-
// https://github.com/joyent/libuv/blob/master/include/uv-errno.h
4847

4948
#[cfg(windows)]
5049
pub mod errors {
@@ -53,7 +52,6 @@ pub mod errors {
5352
pub static EACCES: c_int = -4092;
5453
pub static ECONNREFUSED: c_int = -4078;
5554
pub static ECONNRESET: c_int = -4077;
56-
pub static ENOENT: c_int = -4058;
5755
pub static ENOTCONN: c_int = -4053;
5856
pub static EPIPE: c_int = -4047;
5957
pub static ECONNABORTED: c_int = -4079;
@@ -68,7 +66,6 @@ pub mod errors {
6866
pub static EACCES: c_int = -libc::EACCES;
6967
pub static ECONNREFUSED: c_int = -libc::ECONNREFUSED;
7068
pub static ECONNRESET: c_int = -libc::ECONNRESET;
71-
pub static ENOENT: c_int = -libc::ENOENT;
7269
pub static ENOTCONN: c_int = -libc::ENOTCONN;
7370
pub static EPIPE: c_int = -libc::EPIPE;
7471
pub static ECONNABORTED: c_int = -libc::ECONNABORTED;

branches/try2/src/libstd/ascii.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! Operations on ASCII strings and characters.
1212
13-
use to_str::{ToStr,IntoStr};
13+
use to_str::{ToStr,ToStrConsume};
1414
use str;
1515
use str::StrSlice;
1616
use str::OwnedStr;
@@ -294,7 +294,7 @@ impl<'a> AsciiStr for &'a [Ascii] {
294294
}
295295
}
296296

297-
impl IntoStr for ~[Ascii] {
297+
impl ToStrConsume for ~[Ascii] {
298298
#[inline]
299299
fn into_str(self) -> ~str {
300300
unsafe { cast::transmute(self) }
@@ -309,12 +309,12 @@ impl IterBytes for Ascii {
309309
}
310310

311311
/// Trait to convert to a owned byte array by consuming self
312-
pub trait IntoBytes {
312+
pub trait ToBytesConsume {
313313
/// Converts to a owned byte array by consuming self
314314
fn into_bytes(self) -> ~[u8];
315315
}
316316

317-
impl IntoBytes for ~[Ascii] {
317+
impl ToBytesConsume for ~[Ascii] {
318318
fn into_bytes(self) -> ~[u8] {
319319
unsafe { cast::transmute(self) }
320320
}

0 commit comments

Comments
 (0)