Skip to content

Commit 174b26e

Browse files
committed
---
yaml --- r: 104444 b: refs/heads/try c: 22d3669 h: refs/heads/master v: v3
1 parent 5192bf9 commit 174b26e

Some content is hidden

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

52 files changed

+287
-107
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: ca6d512ec1aa3d66ca1ee05173328b0942e53edb
5+
refs/heads/try: 22d3669b9e7f40a5c05425141dcba6137189ee31
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/.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

branches/try/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Adrien Tétar <[email protected]>
77
Alan Andrade <[email protected]>
88
Aleksander Balicki <[email protected]>
99
Alex Crichton <[email protected]>
10+
Alex Lyon <[email protected]>
1011
Alex Rønne Petersen <[email protected]>
1112
Alexander Stavonin <[email protected]>
1213
Alexandros Tasos <[email protected]>

branches/try/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
;;

branches/try/mk/crates.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@
5050
################################################################################
5151

5252
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections num test
53+
uuid serialize sync getopts collections num test time
5454
HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
5757

5858
DEPS_std := native:rustrt native:compiler-rt
59-
DEPS_extra := std term sync serialize getopts collections
59+
DEPS_extra := std term sync serialize getopts collections time
6060
DEPS_green := std native:context_switch
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std
6363
DEPS_syntax := std term serialize collections
6464
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
65-
collections extra
65+
collections time extra
6666
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \
67-
test
67+
test time
6868
DEPS_flate := std native:miniz
6969
DEPS_arena := std collections
7070
DEPS_glob := std
@@ -78,6 +78,7 @@ DEPS_collections := std serialize
7878
DEPS_fourcc := syntax std
7979
DEPS_num := std extra
8080
DEPS_test := std extra collections getopts serialize term
81+
DEPS_time := std serialize
8182

8283
TOOL_DEPS_compiletest := test green rustuv getopts
8384
TOOL_DEPS_rustdoc := rustdoc green rustuv

branches/try/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))

branches/try/src/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,14 +875,14 @@ An example of what will and will not work for `use` items:
875875

876876
~~~~
877877
# #[allow(unused_imports)];
878-
use foo::extra; // good: foo is at the root of the crate
878+
use foo::extra::json; // good: foo is at the root of the crate
879879
use foo::baz::foobaz; // good: foo is at the root of the crate
880880
881881
mod foo {
882882
extern crate extra;
883883
884-
use foo::extra::time; // good: foo is at crate root
885-
// use extra::*; // bad: extra is not at the crate root
884+
use foo::extra::json; // good: foo is at crate root
885+
// use extra::json::*; // bad: extra is not at the crate root
886886
use self::baz::foobaz; // good: self refers to module 'foo'
887887
use foo::bar::foobar; // good: foo is at crate root
888888

branches/try/src/libextra/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ Rust extras are part of the standard Rust distribution.
3737
extern crate sync;
3838
extern crate serialize;
3939
extern crate collections;
40+
extern crate time;
4041

4142
// Utility modules
4243
pub mod c_vec;
4344
pub mod url;
4445
pub mod json;
4546
pub mod tempfile;
46-
pub mod time;
4747
pub mod workcache;
4848
pub mod stats;
4949

branches/try/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ extern crate serialize;
3939
extern crate sync;
4040
extern crate getopts;
4141
extern crate collections;
42+
extern crate time;
4243

4344
use back::link;
4445
use driver::session;

branches/try/src/librustc/metadata/loader.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ use std::io;
3232
use std::os::consts::{macos, freebsd, linux, android, win32};
3333
use std::str;
3434
use std::vec;
35+
3536
use flate;
37+
use time;
3638

3739
pub enum Os {
3840
OsMacos,
@@ -361,7 +363,6 @@ impl ArchiveMetadata {
361363

362364
// Just a small wrapper to time how long reading metadata takes.
363365
fn get_metadata_section(os: Os, filename: &Path) -> Option<MetadataBlob> {
364-
use extra::time;
365366
let start = time::precise_time_ns();
366367
let ret = get_metadata_section_imp(os, filename);
367368
info!("reading {} => {}ms", filename.filename_display(),
@@ -406,11 +407,8 @@ fn get_metadata_section_imp(os: Os, filename: &Path) -> Option<MetadataBlob> {
406407
debug!("checking {} bytes of metadata-version stamp",
407408
vlen);
408409
let minsz = cmp::min(vlen, csz);
409-
let mut version_ok = false;
410-
vec::raw::buf_as_slice(cvbuf, minsz, |buf0| {
411-
version_ok = (buf0 ==
412-
encoder::metadata_encoding_version);
413-
});
410+
let version_ok = vec::raw::buf_as_slice(cvbuf, minsz,
411+
|buf0| buf0 == encoder::metadata_encoding_version);
414412
if !version_ok { return None; }
415413

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

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

branches/try/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
}

branches/try/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
}

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

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ use util::ppaux::{Repr, ty_to_str};
7272
use util::sha2::Sha256;
7373

7474
use arena::TypedArena;
75-
use extra::time;
7675
use std::c_str::ToCStr;
7776
use std::cell::{Cell, RefCell};
7877
use std::hashmap::HashMap;
@@ -90,6 +89,8 @@ use syntax::visit::Visitor;
9089
use syntax::visit;
9190
use syntax::{ast, ast_util, ast_map};
9291

92+
use time;
93+
9394
pub use middle::trans::context::task_llcx;
9495

9596
local_data_key!(task_local_insn_key: ~[&'static str])

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

0 commit comments

Comments
 (0)