Skip to content

Commit 13f8413

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

Some content is hidden

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

47 files changed

+276
-1032
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: 6d2e61bc6cadcfde6952913b7e170ded57f7b0dd
16+
refs/heads/auto: 1890290ded2b56410b4b2e0dca4c1518b294a2b2
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,11 @@ do
910910
# Try to have LLVM pull in as few dependencies as possible (#9397)
911911
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
912912

913-
# pthreads works badly on mingw-w64 systems: #8996
913+
# Use win32 native thread/lock apis instead of pthread wrapper.
914+
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
915+
# Also note that pthreads works badly on mingw-w64 systems: #8996
914916
case "$CFG_BUILD" in
915-
(*w64-mingw32)
917+
(*-mingw32)
916918
LLVM_OPTS="$LLVM_OPTS --disable-pthreads"
917919
;;
918920
esac

branches/auto/src/etc/mklldeps.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,5 @@
5353
lib = lib[2:] # chop of the leading '-l'
5454
print "#[link(name = \"" + lib + "\", kind = \"static\")]"
5555
if os == 'win32':
56-
print "#[link(name = \"pthread\")]"
5756
print "#[link(name = \"imagehlp\")]"
5857
print "extern {}"

branches/auto/src/etc/snapshot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def scrub(b):
3232
}
3333

3434
winnt_runtime_deps = ["libgcc_s_dw2-1.dll",
35-
"libstdc++-6.dll",
36-
"libpthread-2.dll"]
35+
"libstdc++-6.dll"]
3736

3837
def parse_line(n, line):
3938
global snapshotfile

branches/auto/src/etc/third-party/COPYING.LIB

Lines changed: 0 additions & 482 deletions
This file was deleted.

branches/auto/src/etc/third-party/README.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ Specifically:
66
or (at your option) any later version. See the files COPYING3 and COPYING.RUNTIME respectively.
77
You can obtain a copy of the source of these libraries either here: http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.5.2-1/,
88
or from the project website at http://gcc.gnu.org
9-
10-
- libpthread-2.dll is distributed under the terms of the GNU Lesser General Public License
11-
as published by the Free Software Foundation; either version 2 of the License, or (at your option)
12-
any later version. See the file COPYING.LIB for details.
13-
You can obtain a copy of the source of this library either here: http://sourceforge.net/projects/mingw/files/MinGW/Base/pthreads-w32/pthreads-w32-2.8.0-3/,
14-
or from the project website at http://sourceware.org/pthreads-win32

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

334334

335335
impl Clone for Semaphore {

branches/auto/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/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::{TreeMap, TreeNode};
887+
use super::*;
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!("previous borrow of `{}` as mutable occurs here",
241+
format!("second 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!("previous borrow of `{}` occurs here",
256+
format!("second 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ 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+
}
5056
_ => visit::walk_expr(self, e, cx)
5157
}
5258
}

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

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

1212
use driver::session;
1313
use driver::session::Session;
14+
use syntax::abi;
1415
use syntax::ast::{Crate, NodeId, item, item_fn};
1516
use syntax::ast_map;
1617
use syntax::attr;
@@ -45,7 +46,10 @@ impl Visitor<()> for EntryContext {
4546
}
4647

4748
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
48-
if *session.building_library {
49+
50+
// FIXME #4404 android JNI hacks
51+
if *session.building_library &&
52+
session.targ_cfg.os != abi::OsAndroid {
4953
// No need to find a main function
5054
return;
5155
}
@@ -145,6 +149,10 @@ fn configure_main(this: &mut EntryContext) {
145149
}
146150
}
147151
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);
148156
}
149157
}
150158
}

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

Lines changed: 20 additions & 9 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};
87+
use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32, OsAndroid};
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-
pub struct StatRecorder<'a> {
133+
struct StatRecorder<'a> {
134134
ccx: @mut CrateContext,
135135
name: &'a str,
136136
start: u64,
@@ -2289,7 +2289,11 @@ 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-
if is_entry_fn(&ccx.sess, node_id) && !*ccx.sess.building_library {
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 {
22932297
create_entry_wrapper(ccx, sp, llfn);
22942298
}
22952299
}
@@ -2357,7 +2361,13 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
23572361
let llfty = Type::func([ccx.int_type, Type::i8().ptr_to().ptr_to()],
23582362
&ccx.int_type);
23592363

2360-
let llfn = decl_cdecl_fn(ccx.llmod, "main", llfty);
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);
23612371
let llbb = "top".with_c_str(|buf| {
23622372
unsafe {
23632373
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)
@@ -3189,13 +3199,14 @@ pub fn trans_crate(sess: session::Session,
31893199
}).to_owned_vec();
31903200

31913201
// Make sure that some other crucial symbols are not eliminated from the
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).
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).
31973207
reachable.push(ccx.crate_map_name.to_owned());
31983208
reachable.push(~"main");
3209+
reachable.push(~"amain");
31993210
reachable.push(~"rust_stack_exhausted");
32003211

32013212
return CrateTranslation {

branches/auto/src/librustc/middle/trans/debuginfo.rs

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,11 @@ 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;
135132
use middle::trans::common::*;
136133
use middle::trans::machine;
137134
use middle::trans::type_of;
138135
use middle::trans::type_::Type;
136+
use middle::trans::adt;
139137
use middle::trans;
140138
use middle::ty;
141139
use middle::pat_util;
@@ -455,29 +453,12 @@ pub fn create_self_argument_metadata(bcx: @mut Block,
455453

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

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).
471456
let variable_access = if unsafe { llvm::LLVMIsAAllocaInst(llptr) } != ptr::null() {
472457
DirectVariable { alloca: llptr }
473458
} else {
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 }
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 }
481462
};
482463

483464
declare_local(bcx,

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

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 && !e.variants_stripped {
1205+
if e.variants.len() == 0 {
12061206
write!(w, " \\{\\}");
12071207
} else {
12081208
write!(w, " \\{\n");

branches/auto/src/libstd/hash.rs

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

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

0 commit comments

Comments
 (0)