Skip to content

Commit d526122

Browse files
committed
---
yaml --- r: 102085 b: refs/heads/master c: a0f0699 h: refs/heads/master i: 102083: bdc52c9 v: v3
1 parent 6872887 commit d526122

Some content is hidden

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

74 files changed

+1442
-84
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: 4687e1d67d2601c3a408b74224f5ceb353c77b71
2+
refs/heads/master: a0f0699da68d8b4712035e3b5b42990af2df9cfb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/.travis.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Use something that's not 'ruby' so we don't set up things like
2+
# RVM/bundler/ruby and whatnot. Right now 'rust' isn't a language on travis and
3+
# it treats unknown languages as ruby-like I believe.
4+
language: c
5+
6+
# Before we start doing anything, install the latest stock LLVM. These are
7+
# maintained by LLVM, and more information can be found at llvm.org/apt.
8+
#
9+
# Right now, the highest version is 3.5, and our SVN version is roughly aligned
10+
# with the 3.5 API (hurray!)
11+
install:
12+
- sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list"
13+
- sudo sh -c "echo 'deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list"
14+
- sudo sh -c "echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main' >> /etc/apt/sources.list"
15+
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
16+
- sudo apt-get update -qq
17+
- sudo apt-get install -y --force-yes -qq llvm-3.5 llvm-3.5-dev clang-3.5 lldb-3.5
18+
19+
# All of the llvm tools are suffixed with "-3.5" which we don't want, so symlink
20+
# them all into a local directory and just use that
21+
#
22+
# FIXME: this shouldn't update the src/llvm sub-repo, that takes about a minute
23+
# it's gotta download so much stuff.
24+
before_script:
25+
- mkdir -p local-llvm/bin
26+
- ln -nsf /usr/bin/llvm-config-3.5 local-llvm/bin/llvm-config
27+
- ln -nsf /usr/bin/llvm-mc-3.5 local-llvm/bin/llvm-mc
28+
- ln -nsf /usr/bin/llvm-as-3.5 local-llvm/bin/llvm-as
29+
- ln -nsf /usr/bin/llvm-dis-3.5 local-llvm/bin/llvm-dis
30+
- ln -nsf /usr/bin/llc-3.5 local-llvm/bin/llc
31+
- ln -nsf /usr/include/llvm-3.5 local-llvm/include
32+
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm --enable-fast-make --enable-clang
33+
34+
# Tidy everything up first, then build a few things, and then run a few tests.
35+
# Note that this is meant to run in a "fairly small" amount of time, so this
36+
# isn't exhaustive at all.
37+
#
38+
# The "-lffi and -lncurses" are required for LLVM. The LLVM that rust builds
39+
# manually disables bringing in these two libraries, but the stock LLVM was
40+
# apparently built with these options. We provide these options when building so
41+
# the `rustc` binary can successfully link.
42+
script:
43+
- make tidy
44+
- RUSTFLAGS="-C link-args='-lffi -lncurses'" make -j4 rustc-stage1
45+
- make check-stage1-std check-stage1-rpass check-stage1-cfail check-stage1-rfail
46+
47+
env:
48+
- NO_BENCH=1
49+
50+
# We track this ourselves, and in theory we don't have to update the LLVM repo
51+
# (but sadly we do right now anyway).
52+
git:
53+
submodules: false

trunk/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ then
604604
LLVM_VERSION=$($LLVM_CONFIG --version)
605605

606606
case $LLVM_VERSION in
607-
(3.[2-4]svn|3.[2-4])
607+
(3.[2-5]svn|3.[2-5])
608608
msg "found ok version of LLVM: $LLVM_VERSION"
609609
;;
610610
(*)
@@ -626,7 +626,7 @@ then
626626
| cut -d ' ' -f 2)
627627

628628
case $CFG_CLANG_VERSION in
629-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* )
629+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* )
630630
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
631631
CFG_C_COMPILER="clang"
632632
;;

trunk/mk/main.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt llvm-extract
218218
define DEF_LLVM_VARS
219219
# The configure script defines these variables with the target triples
220220
# separated by Z. This defines new ones with the expected format.
221+
ifeq ($$(CFG_LLVM_ROOT),)
221222
CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
222223
CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
224+
else
225+
CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_ROOT)
226+
endif
223227

224228
# Any rules that depend on LLVM should depend on LLVM_CONFIG
225229
LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X_$(1))

trunk/mk/prepare.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# It requires the following variables to be set:
1818
#
19-
# PREPARE_HOST - the host triple
19+
# PREPARE_HOST - the host triple
2020
# PREPARE_TARGETS - the target triples, space separated
2121
# PREPARE_DEST_DIR - the directory to put the image
2222

@@ -172,7 +172,10 @@ prepare-target-$(2)-host-$(3)-$(1): \
172172
$$(if $$(findstring $(2),$$(CFG_HOST)), \
173173
$$(foreach crate,$$(HOST_CRATES), \
174174
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)),)
175-
# Only install if this host and target combo is being prepared
175+
# Only install if this host and target combo is being prepared. Also be sure to
176+
# *not* install the rlibs for host crates because there's no need to statically
177+
# link against most of them. They just produce a large amount of extra size
178+
# bloat.
176179
$$(if $$(findstring $(1), $$(PREPARE_STAGE)),\
177180
$$(if $$(findstring $(2), $$(PREPARE_TARGETS)),\
178181
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
@@ -182,8 +185,7 @@ prepare-target-$(2)-host-$(3)-$(1): \
182185
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate))))\
183186
$$(if $$(findstring $(2),$$(CFG_HOST)),\
184187
$$(foreach crate,$$(HOST_CRATES),\
185-
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))\
186-
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate)))),)\
188+
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))),)\
187189
$$(call PREPARE_LIB,libmorestack.a) \
188190
$$(call PREPARE_LIB,libcompiler-rt.a),),),)
189191
endef

trunk/src/etc/generate-deriving-span-tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def write_file(name, string):
119119
('Clone', [], 1), ('DeepClone', ['Clone'], 1),
120120
('Eq', [], 2), ('Ord', [], 8),
121121
('TotalEq', [], 1), ('TotalOrd', ['TotalEq'], 1),
122-
('Show', [], 1)]:
122+
('Show', [], 1),
123+
('Hash', [], 1)]:
123124
traits[trait] = (ALL, supers, errs)
124125

125126
for (trait, (types, super_traits, error_count)) in traits.items():

trunk/src/libextra/stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#[allow(missing_doc)];
1212

1313
use std::cmp;
14+
use std::hash_old::Hash;
1415
use std::hashmap;
1516
use std::io;
1617
use std::mem;

trunk/src/librustc/back/link.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use std::run;
3434
use std::str;
3535
use std::io;
3636
use std::io::fs;
37+
use flate;
3738
use serialize::hex::ToHex;
3839
use extra::tempfile::TempDir;
3940
use syntax::abi;
@@ -942,6 +943,15 @@ fn link_rlib(sess: Session,
942943
// For LTO purposes, the bytecode of this library is also inserted
943944
// into the archive.
944945
let bc = obj_filename.with_extension("bc");
946+
match fs::File::open(&bc).read_to_end().and_then(|data| {
947+
fs::File::create(&bc).write(flate::deflate_bytes(data))
948+
}) {
949+
Ok(()) => {}
950+
Err(e) => {
951+
sess.err(format!("failed to compress bytecode: {}", e));
952+
sess.abort_if_errors()
953+
}
954+
}
945955
a.add_file(&bc, false);
946956
if !sess.opts.cg.save_temps &&
947957
!sess.opts.output_types.contains(&OutputTypeBitcode) {

trunk/src/librustc/back/lto.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use metadata::cstore;
1616
use util::common::time;
1717

1818
use std::libc;
19+
use flate;
1920

2021
pub fn run(sess: session::Session, llmod: ModuleRef,
2122
tm: TargetMachineRef, reachable: &[~str]) {
@@ -55,6 +56,8 @@ pub fn run(sess: session::Session, llmod: ModuleRef,
5556
let bc = time(sess.time_passes(), format!("read {}.bc", name), (), |_|
5657
archive.read(format!("{}.bc", name)));
5758
let bc = bc.expect("missing bytecode in archive!");
59+
let bc = time(sess.time_passes(), format!("inflate {}.bc", name), (), |_|
60+
flate::inflate_bytes(bc));
5861
let ptr = bc.as_ptr();
5962
debug!("linking {}", name);
6063
time(sess.time_passes(), format!("ll link {}", name), (), |()| unsafe {

trunk/src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use middle::typeck;
2727
use middle::astencode::vtable_decoder_helpers;
2828

2929
use std::u64;
30+
use std::hash_old::Hash;
3031
use std::io;
3132
use std::io::extensions::u64_from_be_bytes;
3233
use std::option;

trunk/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use middle;
2626
use serialize::Encodable;
2727
use std::cast;
2828
use std::cell::{Cell, RefCell};
29+
use std::hash_old::Hash;
2930
use std::hashmap::{HashMap, HashSet};
3031
use std::io::MemWriter;
3132
use std::str;

trunk/src/librustc/metadata/loader.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,8 @@ fn get_metadata_section_imp(os: Os, filename: &Path) -> Option<MetadataBlob> {
407407
debug!("checking {} bytes of metadata-version stamp",
408408
vlen);
409409
let minsz = cmp::min(vlen, csz);
410-
let mut version_ok = false;
411-
vec::raw::buf_as_slice(cvbuf, minsz, |buf0| {
412-
version_ok = (buf0 ==
413-
encoder::metadata_encoding_version);
414-
});
410+
let version_ok = vec::raw::buf_as_slice(cvbuf, minsz,
411+
|buf0| buf0 == encoder::metadata_encoding_version);
415412
if !version_ok { return None; }
416413

417414
let cvbuf1 = cvbuf.offset(vlen as int);

trunk/src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ impl<'a> GuaranteeLifetimeContext<'a> {
9595
let base_scope = self.scope(base);
9696

9797
// L-Deref-Managed-Imm-User-Root
98-
let omit_root = (
98+
let omit_root =
9999
self.bccx.is_subregion_of(self.loan_region, base_scope) &&
100100
self.is_rvalue_or_immutable(base) &&
101-
!self.is_moved(base)
102-
);
101+
!self.is_moved(base);
103102

104103
if !omit_root {
105104
// L-Deref-Managed-Imm-Compiler-Root

trunk/src/librustc/middle/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ fn bitwise(out_vec: &mut [uint], in_vec: &[uint], op: |uint, uint| -> uint)
891891
let old_val = *out_elt;
892892
let new_val = op(old_val, *in_elt);
893893
*out_elt = new_val;
894-
changed |= (old_val != new_val);
894+
changed |= old_val != new_val;
895895
}
896896
changed
897897
}

trunk/src/librustc/middle/lint.rs

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,22 +1167,41 @@ fn check_pat_non_uppercase_statics(cx: &Context, p: &ast::Pat) {
11671167
}
11681168
}
11691169

1170-
fn check_unnecessary_parens(cx: &Context, e: &ast::Expr) {
1170+
fn check_unnecessary_parens_core(cx: &Context, value: &ast::Expr, msg: &str) {
1171+
match value.node {
1172+
ast::ExprParen(_) => {
1173+
cx.span_lint(UnnecessaryParens, value.span,
1174+
format!("unnecessary parentheses around {}", msg))
1175+
}
1176+
_ => {}
1177+
}
1178+
}
1179+
1180+
fn check_unnecessary_parens_expr(cx: &Context, e: &ast::Expr) {
11711181
let (value, msg) = match e.node {
11721182
ast::ExprIf(cond, _, _) => (cond, "`if` condition"),
11731183
ast::ExprWhile(cond, _) => (cond, "`while` condition"),
11741184
ast::ExprMatch(head, _) => (head, "`match` head expression"),
11751185
ast::ExprRet(Some(value)) => (value, "`return` value"),
1186+
ast::ExprAssign(_, value) => (value, "assigned value"),
1187+
ast::ExprAssignOp(_, _, _, value) => (value, "assigned value"),
11761188
_ => return
11771189
};
1190+
check_unnecessary_parens_core(cx, value, msg);
1191+
}
11781192

1179-
match value.node {
1180-
ast::ExprParen(_) => {
1181-
cx.span_lint(UnnecessaryParens, value.span,
1182-
format!("unnecessary parentheses around {}", msg))
1183-
}
1184-
_ => {}
1185-
}
1193+
fn check_unnecessary_parens_stmt(cx: &Context, s: &ast::Stmt) {
1194+
let (value, msg) = match s.node {
1195+
ast::StmtDecl(decl, _) => match decl.node {
1196+
ast::DeclLocal(local) => match local.init {
1197+
Some(value) => (value, "assigned value"),
1198+
None => return
1199+
},
1200+
_ => return
1201+
},
1202+
_ => return
1203+
};
1204+
check_unnecessary_parens_core(cx, value, msg);
11861205
}
11871206

11881207
fn check_unused_unsafe(cx: &Context, e: &ast::Expr) {
@@ -1534,7 +1553,7 @@ impl<'a> Visitor<()> for Context<'a> {
15341553

15351554
check_while_true_expr(self, e);
15361555
check_stability(self, e);
1537-
check_unnecessary_parens(self, e);
1556+
check_unnecessary_parens_expr(self, e);
15381557
check_unused_unsafe(self, e);
15391558
check_unsafe_block(self, e);
15401559
check_unnecessary_allocation(self, e);
@@ -1549,6 +1568,7 @@ impl<'a> Visitor<()> for Context<'a> {
15491568
fn visit_stmt(&mut self, s: &ast::Stmt, _: ()) {
15501569
check_path_statement(self, s);
15511570
check_unused_result(self, s);
1571+
check_unnecessary_parens_stmt(self, s);
15521572

15531573
visit::walk_stmt(self, s, ());
15541574
}

trunk/src/librustc/middle/reachable.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,23 @@ pub fn find_reachable(tcx: ty::ctxt,
404404
let reachable_context = ReachableContext::new(tcx, method_map);
405405

406406
// Step 1: Seed the worklist with all nodes which were found to be public as
407-
// a result of the privacy pass
407+
// a result of the privacy pass along with all local lang items. If
408+
// other crates link to us, they're going to expect to be able to
409+
// use the lang items, so we need to be sure to mark them as
410+
// exported.
411+
let mut worklist = reachable_context.worklist.borrow_mut();
408412
for &id in exported_items.iter() {
409-
let mut worklist = reachable_context.worklist.borrow_mut();
410413
worklist.get().push(id);
411414
}
415+
for (_, item) in tcx.lang_items.items() {
416+
match *item {
417+
Some(did) if is_local(did) => {
418+
worklist.get().push(did.node);
419+
}
420+
_ => {}
421+
}
422+
}
423+
drop(worklist);
412424

413425
// Step 2: Mark all symbols that the symbols on the worklist touch.
414426
reachable_context.propagate();

trunk/src/librustc/middle/trans/monomorphize.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ pub fn monomorphic_fn(ccx: @CrateContext,
143143
// This is a bit unfortunate.
144144

145145
let idx = psubsts.tys.len() - num_method_ty_params;
146-
let substs =
147-
(psubsts.tys.slice(0, idx) +
148-
&[psubsts.self_ty.unwrap()] +
149-
psubsts.tys.tailn(idx));
146+
let substs = psubsts.tys.slice(0, idx) +
147+
&[psubsts.self_ty.unwrap()] + psubsts.tys.tailn(idx);
150148
debug!("static default: changed substitution to {}",
151149
substs.repr(ccx.tcx));
152150

trunk/src/librustc/middle/ty.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,8 +2293,8 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
22932293
bounds: BuiltinBounds)
22942294
-> TypeContents {
22952295
// These are the type contents of the (opaque) interior
2296-
let contents = (TC::ReachesMutable.when(mutbl == ast::MutMutable) |
2297-
kind_bounds_to_contents(cx, bounds, []));
2296+
let contents = TC::ReachesMutable.when(mutbl == ast::MutMutable) |
2297+
kind_bounds_to_contents(cx, bounds, []);
22982298

22992299
match store {
23002300
UniqTraitStore => {
@@ -3691,15 +3691,15 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str {
36913691
}
36923692
}
36933693
terr_integer_as_char => {
3694-
format!("expected an integral type but found char")
3694+
format!("expected an integral type but found `char`")
36953695
}
36963696
terr_int_mismatch(ref values) => {
3697-
format!("expected {} but found {}",
3697+
format!("expected `{}` but found `{}`",
36983698
values.expected.to_str(),
36993699
values.found.to_str())
37003700
}
37013701
terr_float_mismatch(ref values) => {
3702-
format!("expected {} but found {}",
3702+
format!("expected `{}` but found `{}`",
37033703
values.expected.to_str(),
37043704
values.found.to_str())
37053705
}
@@ -3767,13 +3767,13 @@ pub fn provided_trait_methods(cx: ctxt, id: ast::DefId) -> ~[@Method] {
37673767
}
37683768
_ => {
37693769
cx.sess.bug(format!("provided_trait_methods: \
3770-
{:?} is not a trait",
3770+
`{:?}` is not a trait",
37713771
id))
37723772
}
37733773
}
37743774
}
37753775
_ => {
3776-
cx.sess.bug(format!("provided_trait_methods: {:?} is not \
3776+
cx.sess.bug(format!("provided_trait_methods: `{:?}` is not \
37773777
a trait",
37783778
id))
37793779
}
@@ -4916,7 +4916,7 @@ pub fn trait_method_of_method(tcx: ctxt,
49164916
/// Creates a hash of the type `t` which will be the same no matter what crate
49174917
/// context it's calculated within. This is used by the `type_id` intrinsic.
49184918
pub fn hash_crate_independent(tcx: ctxt, t: t, local_hash: ~str) -> u64 {
4919-
use std::hash::{SipState, Streaming};
4919+
use std::hash_old::{SipState, Streaming};
49204920

49214921
let mut hash = SipState::new(0, 0);
49224922
let region = |_hash: &mut SipState, r: Region| {

0 commit comments

Comments
 (0)