Skip to content

Commit c9fe02c

Browse files
committed
---
yaml --- r: 92403 b: refs/heads/auto c: c87b9d3 h: refs/heads/master i: 92401: 13f8413 92399: e530950 v: v3
1 parent 7957591 commit c9fe02c

Some content is hidden

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

41 files changed

+538
-270
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: b0a9937a6d252eaf6c936284c377227ae510cc0f
16+
refs/heads/auto: c87b9d37f7a72e8632af676c2bb579f8967d9cd8
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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/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/librustc/middle/trans/debuginfo.rs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ use driver::session;
129129
use lib::llvm::llvm;
130130
use lib::llvm::{ModuleRef, ContextRef, ValueRef};
131131
use lib::llvm::debuginfo::*;
132+
use middle::trans::adt;
133+
use middle::trans::base;
134+
use middle::trans::build;
132135
use middle::trans::common::*;
133136
use middle::trans::machine;
134137
use middle::trans::type_of;
135138
use middle::trans::type_::Type;
136-
use middle::trans::adt;
137139
use middle::trans;
138140
use middle::ty;
139141
use middle::pat_util;
@@ -453,12 +455,29 @@ pub fn create_self_argument_metadata(bcx: @mut Block,
453455

454456
let address_operations = &[unsafe { llvm::LLVMDIBuilderCreateOpDeref(Type::i64().to_ref()) }];
455457

458+
// The self argument comes in one of two forms:
459+
// (1) For `&self`, `~self`, and `@self` it is an alloca containing a pointer to the data. That
460+
// is the `{&~@}self` pointer is contained by value in the alloca, and `type_of_self` will
461+
// be `{&~@}Self`
462+
// (2) For by-value `self`, `llptr` will not be an alloca, but a pointer to the self-value. That
463+
// is by-value `self` is always implicitly passed by reference (sic!). So we have a couple
464+
// of problems here:
465+
// (a) There is no alloca to give to `llvm.dbg.declare` and
466+
// (b) `type_of_self` is `Self`, but `llptr` is of type `*Self`
467+
// In order to solve this problem, the else branch below creates a helper alloca which
468+
// contains a copy of `llptr`. We then describe the `self` parameter by pointing
469+
// `llvm.dbg.declare` to this helper alloca and tell it that the pointer there needs to be
470+
// dereferenced once to get to the actual data (similar to non-immediate by-value args).
456471
let variable_access = if unsafe { llvm::LLVMIsAAllocaInst(llptr) } != ptr::null() {
457472
DirectVariable { alloca: llptr }
458473
} else {
459-
// This is not stable and may break with future LLVM versions. llptr should really always
460-
// be an alloca. Anything else is not supported and just works by chance.
461-
IndirectVariable { alloca: llptr, address_operations: address_operations }
474+
// Create a helper alloca that allows us to track the self-argument properly. The alloca
475+
// contains a pointer to the self-value.
476+
let ptr_type = ty::mk_mut_ptr(bcx.tcx(), type_of_self);
477+
let helper_alloca = base::alloc_ty(bcx, ptr_type, "__self");
478+
build::Store(bcx, llptr, helper_alloca);
479+
480+
IndirectVariable { alloca: helper_alloca, address_operations: address_operations }
462481
};
463482

464483
declare_local(bcx,

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ fn item_enum(w: &mut Writer, it: &clean::Item, e: &clean::Enum) {
12021202
VisSpace(it.visibility),
12031203
it.name.get_ref().as_slice(),
12041204
e.generics);
1205-
if e.variants.len() == 0 {
1205+
if e.variants.len() == 0 && !e.variants_stripped {
12061206
write!(w, " \\{\\}");
12071207
} else {
12081208
write!(w, " \\{\n");

branches/auto/src/libstd/hash.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ impl Streaming for SipState {
303303
mod tests {
304304
use super::*;
305305
use prelude::*;
306+
use super::SipState;
306307

307308
// Hash just the bytes of the slice, without length prefix
308309
struct Bytes<'a>(&'a [u8]);

branches/auto/src/libstd/rt/mpmc_bounded_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct State<T> {
5151
pad3: [u8, ..64],
5252
}
5353

54-
struct Queue<T> {
54+
pub struct Queue<T> {
5555
priv state: UnsafeArc<State<T>>,
5656
}
5757

branches/auto/src/libsyntax/parse/obsolete.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub enum ObsoleteSyntax {
4444
ObsoleteVecDotDotWildcard,
4545
ObsoleteBoxedClosure,
4646
ObsoleteClosureType,
47+
ObsoleteMultipleImport,
4748
}
4849

4950
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -140,6 +141,10 @@ impl ParserObsoleteMethods for Parser {
140141
"closures are now written `|A| -> B` rather than `&fn(A) -> \
141142
B`."
142143
),
144+
ObsoleteMultipleImport => (
145+
"multiple imports",
146+
"only one import is allowed per `use` statement"
147+
),
143148
};
144149

145150
self.report(sp, kind, kind_str, desc);

branches/auto/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,6 +4968,7 @@ impl Parser {
49684968
let mut vp = ~[self.parse_view_path()];
49694969
while *self.token == token::COMMA {
49704970
self.bump();
4971+
self.obsolete(*self.last_span, ObsoleteMultipleImport);
49714972
vp.push(self.parse_view_path());
49724973
}
49734974
return vp;

0 commit comments

Comments
 (0)