Skip to content

Commit 5da81ce

Browse files
committed
---
yaml --- r: 92398 b: refs/heads/auto c: 5ece092 h: refs/heads/master v: v3
1 parent b2226f5 commit 5da81ce

File tree

38 files changed

+219
-598
lines changed

38 files changed

+219
-598
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 01fae5fb2a0425af2830b2525c49d27bfba68899
16+
refs/heads/auto: 5ece09277387acf8895f89d439a6cbce4bb55adf
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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

branches/auto/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

branches/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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

branches/auto/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() {

branches/auto/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/auto/src/librustc/middle/check_loop.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ impl Visitor<Context> for CheckLoopVisitor {
4747
}
4848
ast::ExprBreak(_) => self.require_loop("break", cx, e.span),
4949
ast::ExprAgain(_) => self.require_loop("continue", cx, e.span),
50-
ast::ExprRet(oe) => {
51-
if cx == Closure {
52-
self.tcx.sess.span_err(e.span, "`return` in a closure");
53-
}
54-
visit::walk_expr_opt(self, oe, cx);
55-
}
5650
_ => visit::walk_expr(self, e, cx)
5751
}
5852
}

branches/auto/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, _: ()) {

branches/auto/src/librustc/middle/entry.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use driver::session;
1313
use driver::session::Session;
14-
use syntax::abi;
1514
use syntax::ast::{Crate, NodeId, item, item_fn};
1615
use syntax::ast_map;
1716
use syntax::attr;
@@ -46,10 +45,7 @@ impl Visitor<()> for EntryContext {
4645
}
4746

4847
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
49-
50-
// FIXME #4404 android JNI hacks
51-
if *session.building_library &&
52-
session.targ_cfg.os != abi::OsAndroid {
48+
if *session.building_library {
5349
// No need to find a main function
5450
return;
5551
}
@@ -149,10 +145,6 @@ fn configure_main(this: &mut EntryContext) {
149145
}
150146
}
151147
this.session.abort_if_errors();
152-
} else {
153-
// If we *are* building a library, then we're on android where we still might
154-
// optionally want to translate main $4404
155-
assert_eq!(this.session.targ_cfg.os, abi::OsAndroid);
156148
}
157149
}
158150
}

branches/auto/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/auto/src/librustc/middle/trans/base.rs

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ use syntax::parse::token::{special_idents};
8484
use syntax::print::pprust::stmt_to_str;
8585
use syntax::{ast, ast_util, codemap, ast_map};
8686
use syntax::attr::AttrMetaMethods;
87-
use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32, OsAndroid};
87+
use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32};
8888
use syntax::visit;
8989
use syntax::visit::Visitor;
9090

@@ -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,
@@ -2289,11 +2289,7 @@ fn finish_register_fn(ccx: @mut CrateContext, sp: Span, sym: ~str, node_id: ast:
22892289
lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
22902290
}
22912291

2292-
// FIXME #4404 android JNI hacks
2293-
let is_entry = is_entry_fn(&ccx.sess, node_id) && (!*ccx.sess.building_library ||
2294-
(*ccx.sess.building_library &&
2295-
ccx.sess.targ_cfg.os == OsAndroid));
2296-
if is_entry {
2292+
if is_entry_fn(&ccx.sess, node_id) && !*ccx.sess.building_library {
22972293
create_entry_wrapper(ccx, sp, llfn);
22982294
}
22992295
}
@@ -2361,13 +2357,7 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
23612357
let llfty = Type::func([ccx.int_type, Type::i8().ptr_to().ptr_to()],
23622358
&ccx.int_type);
23632359

2364-
// FIXME #4404 android JNI hacks
2365-
let main_name = if *ccx.sess.building_library {
2366-
"amain"
2367-
} else {
2368-
"main"
2369-
};
2370-
let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
2360+
let llfn = decl_cdecl_fn(ccx.llmod, "main", llfty);
23712361
let llbb = "top".with_c_str(|buf| {
23722362
unsafe {
23732363
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)
@@ -3199,14 +3189,13 @@ pub fn trans_crate(sess: session::Session,
31993189
}).to_owned_vec();
32003190

32013191
// Make sure that some other crucial symbols are not eliminated from the
3202-
// module. This includes the main function (main/amain elsewhere), the crate
3203-
// map (used for debug log settings and I/O), and finally the curious
3204-
// rust_stack_exhausted symbol. This symbol is required for use by the
3205-
// libmorestack library that we link in, so we must ensure that this symbol
3206-
// is not internalized (if defined in the crate).
3192+
// module. This includes the main function, the crate map (used for debug
3193+
// log settings and I/O), and finally the curious rust_stack_exhausted
3194+
// symbol. This symbol is required for use by the libmorestack library that
3195+
// we link in, so we must ensure that this symbol is not internalized (if
3196+
// defined in the crate).
32073197
reachable.push(ccx.crate_map_name.to_owned());
32083198
reachable.push(~"main");
3209-
reachable.push(~"amain");
32103199
reachable.push(~"rust_stack_exhausted");
32113200

32123201
return CrateTranslation {

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

0 commit comments

Comments
 (0)