Skip to content

Commit 0cdca78

Browse files
committed
---
yaml --- r: 274895 b: refs/heads/stable c: 97a87ef h: refs/heads/master i: 274893: 5513d2f 274891: 77c4af5 274887: 08dda6e 274879: 9cc684a
1 parent e5ef07d commit 0cdca78

File tree

124 files changed

+379
-82
lines changed

Some content is hidden

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

124 files changed

+379
-82
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 15e5cf383ddba4ace0acdb045c55d25bc3432f38
32+
refs/heads/stable: 97a87ef509d8202f3b6ed2178e9b14211481c8d1
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# i586-unknown-linux-gnu configuration
2+
CC_i586-unknown-linux-gnu=$(CC)
3+
CXX_i586-unknown-linux-gnu=$(CXX)
4+
CPP_i586-unknown-linux-gnu=$(CPP)
5+
AR_i586-unknown-linux-gnu=$(AR)
6+
CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
7+
CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
8+
CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
12+
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
13+
CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
14+
CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
15+
CFG_LLC_FLAGS_i586-unknown-linux-gnu :=
16+
CFG_INSTALL_NAME_i586-unknown-linux-gnu =
17+
CFG_EXE_SUFFIX_i586-unknown-linux-gnu =
18+
CFG_WINDOWSY_i586-unknown-linux-gnu :=
19+
CFG_UNIXY_i586-unknown-linux-gnu := 1
20+
CFG_LDPATH_i586-unknown-linux-gnu :=
21+
CFG_RUN_i586-unknown-linux-gnu=$(2)
22+
CFG_RUN_TARG_i586-unknown-linux-gnu=$(call CFG_RUN_i586-unknown-linux-gnu,,$(2))
23+
CFG_GNU_TRIPLE_i586-unknown-linux-gnu := i586-unknown-linux-gnu
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::fs;
12+
use std::path::Path;
13+
14+
use build::Build;
15+
16+
pub fn clean(build: &Build) {
17+
for host in build.config.host.iter() {
18+
19+
let out = build.out.join(host);
20+
21+
rm_rf(build, &out.join("compiler-rt"));
22+
23+
for stage in 0..4 {
24+
rm_rf(build, &out.join(format!("stage{}", stage)));
25+
rm_rf(build, &out.join(format!("stage{}-std", stage)));
26+
rm_rf(build, &out.join(format!("stage{}-rustc", stage)));
27+
}
28+
}
29+
}
30+
31+
fn rm_rf(build: &Build, path: &Path) {
32+
if path.exists() {
33+
build.verbose(&format!("removing `{}`", path.display()));
34+
t!(fs::remove_dir_all(path));
35+
}
36+
}

branches/stable/src/bootstrap/build/flags.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct Flags {
2626
pub src: Option<PathBuf>,
2727
pub jobs: Option<u32>,
2828
pub args: Vec<String>,
29+
pub clean: bool,
2930
}
3031

3132
pub struct Filter {
@@ -44,6 +45,7 @@ impl Flags {
4445
opts.optopt("", "stage", "stage to build", "N");
4546
opts.optopt("", "src", "path to repo root", "DIR");
4647
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
48+
opts.optflag("", "clean", "clean output directory");
4749
opts.optflag("h", "help", "print this help message");
4850

4951
let usage = |n| -> ! {
@@ -75,6 +77,7 @@ impl Flags {
7577

7678
Flags {
7779
verbose: m.opt_present("v"),
80+
clean: m.opt_present("clean"),
7881
stage: m.opt_str("stage").map(|j| j.parse().unwrap()),
7982
build: m.opt_str("build").unwrap(),
8083
host: Filter { values: m.opt_strs("host") },

branches/stable/src/bootstrap/build/job.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,20 @@ pub unsafe fn setup() {
6464
mem::size_of_val(&info) as DWORD);
6565
assert!(r != 0, "{}", io::Error::last_os_error());
6666

67-
// Assign our process to this job object
67+
// Assign our process to this job object. Note that if this fails, one very
68+
// likely reason is that we are ourselves already in a job object! This can
69+
// happen on the build bots that we've got for Windows, or if just anyone
70+
// else is instrumenting the build. In this case we just bail out
71+
// immediately and assume that they take care of it.
72+
//
73+
// Also note that nested jobs (why this might fail) are supported in recent
74+
// versions of Windows, but the version of Windows that our bots are running
75+
// at least don't support nested job objects.
6876
let r = AssignProcessToJobObject(job, GetCurrentProcess());
69-
assert!(r != 0, "{}", io::Error::last_os_error());
77+
if r == 0 {
78+
CloseHandle(job);
79+
return
80+
}
7081

7182
// If we've got a parent process (e.g. the python script that called us)
7283
// then move ownership of this job object up to them. That way if the python

branches/stable/src/bootstrap/build/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ macro_rules! t {
3030

3131
mod cc;
3232
mod channel;
33+
mod clean;
3334
mod compile;
3435
mod config;
3536
mod flags;
@@ -122,6 +123,10 @@ impl Build {
122123
#[cfg(not(windows))] fn setup_job() {}
123124
setup_job();
124125

126+
if self.flags.clean {
127+
return clean::clean(self);
128+
}
129+
125130
cc::find(self);
126131
sanity::check(self);
127132
channel::collect(self);

branches/stable/src/bootstrap/mk/Makefile.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ BOOTSTRAP := $(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap.py $(BOOTSTRAP_
2121

2222
all:
2323
$(Q)$(BOOTSTRAP)
24+
25+
clean:
26+
$(Q)$(BOOTSTRAP) --clean

branches/stable/src/doc/book/concurrency.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ use std::sync::mpsc;
286286
fn main() {
287287
let data = Arc::new(Mutex::new(0));
288288

289+
// `tx` is the "transmitter" or "sender"
290+
// `rx` is the "receiver"
289291
let (tx, rx) = mpsc::channel();
290292

291293
for _ in 0..10 {

branches/stable/src/doc/book/documentation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,23 @@ our source code:
319319
```text
320320
First, we set `x` to five:
321321
322-
```text
322+
```rust
323323
let x = 5;
324324
# let y = 6;
325325
# println!("{}", x + y);
326326
```
327327
328328
Next, we set `y` to six:
329329
330-
```text
330+
```rust
331331
# let x = 5;
332332
let y = 6;
333333
# println!("{}", x + y);
334334
```
335335
336336
Finally, we print the sum of `x` and `y`:
337337
338-
```text
338+
```rust
339339
# let x = 5;
340340
# let y = 6;
341341
println!("{}", x + y);

branches/stable/src/doc/book/ownership.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ fn foo() {
5151
}
5252
```
5353

54-
When `v` comes into scope, a new [vector] is created, and it allocates space on
55-
[the heap][heap] for each of its elements. When `v` goes out of scope at the
56-
end of `foo()`, Rust will clean up everything related to the vector, even the
57-
heap-allocated memory. This happens deterministically, at the end of the scope.
54+
When `v` comes into scope, a new [vector] is created on [the stack][stack],
55+
and it allocates space on [the heap][heap] for its elements. When `v` goes out
56+
of scope at the end of `foo()`, Rust will clean up everything related to the
57+
vector, even the heap-allocated memory. This happens deterministically, at the
58+
end of the scope.
5859

5960
We'll cover [vectors] in detail later in this chapter; we only use them
6061
here as an example of a type that allocates space on the heap at runtime. They
@@ -67,6 +68,7 @@ Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will ha
6768
[arrays]: primitive-types.html#arrays
6869
[vectors]: vectors.html
6970
[heap]: the-stack-and-the-heap.html
71+
[stack]: the-stack-and-the-heap.html#the-stack
7072
[bindings]: variable-bindings.html
7173
[generics]: generics.html
7274

branches/stable/src/doc/book/using-rust-without-the-standard-library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ don’t want to use the standard library via an attribute: `#![no_std]`.
1111
> For details on binaries without the standard library, see [the nightly
1212
> chapter on `#![no_std]`](no-stdlib.html)
1313
14-
To use `#![no_std]`, add a it to your crate root:
14+
To use `#![no_std]`, add it to your crate root:
1515

1616
```rust
1717
#![no_std]

branches/stable/src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl<T> Vec<T> {
528528
}
529529

530530
/// Inserts an element at position `index` within the vector, shifting all
531-
/// elements after position `i` one position to the right.
531+
/// elements after it to the right.
532532
///
533533
/// # Panics
534534
///
@@ -570,7 +570,7 @@ impl<T> Vec<T> {
570570
}
571571

572572
/// Removes and returns the element at position `index` within the vector,
573-
/// shifting all elements after position `index` one position to the left.
573+
/// shifting all elements after it to the left.
574574
///
575575
/// # Panics
576576
///

branches/stable/src/libcore/num/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,13 @@ macro_rules! int_impl {
741741
/// where `mask` removes any high-order bits of `rhs` that
742742
/// would cause the shift to exceed the bitwidth of the type.
743743
///
744+
/// Note that this is *not* the same as a rotate-left; the
745+
/// RHS of a wrapping shift-left is restricted to the range
746+
/// of the type, rather than the bits shifted out of the LHS
747+
/// being returned to the other end. The primitive integer
748+
/// types all implement a `rotate_left` function, which may
749+
/// be what you want instead.
750+
///
744751
/// # Examples
745752
///
746753
/// Basic usage:
@@ -759,6 +766,13 @@ macro_rules! int_impl {
759766
/// where `mask` removes any high-order bits of `rhs` that
760767
/// would cause the shift to exceed the bitwidth of the type.
761768
///
769+
/// Note that this is *not* the same as a rotate-right; the
770+
/// RHS of a wrapping shift-right is restricted to the range
771+
/// of the type, rather than the bits shifted out of the LHS
772+
/// being returned to the other end. The primitive integer
773+
/// types all implement a `rotate_right` function, which may
774+
/// be what you want instead.
775+
///
762776
/// # Examples
763777
///
764778
/// Basic usage:

branches/stable/src/librustc/lint/context.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
758758
run_lints!(cx, check_item, late_passes, it);
759759
cx.visit_ids(|v| v.visit_item(it));
760760
hir_visit::walk_item(cx, it);
761+
run_lints!(cx, check_item_post, late_passes, it);
761762
})
762763
}
763764

@@ -846,6 +847,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
846847
fn visit_block(&mut self, b: &hir::Block) {
847848
run_lints!(self, check_block, late_passes, b);
848849
hir_visit::walk_block(self, b);
850+
run_lints!(self, check_block_post, late_passes, b);
849851
}
850852

851853
fn visit_arm(&mut self, a: &hir::Arm) {
@@ -918,6 +920,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
918920
run_lints!(cx, check_item, early_passes, it);
919921
cx.visit_ids(|v| v.visit_item(it));
920922
ast_visit::walk_item(cx, it);
923+
run_lints!(cx, check_item_post, early_passes, it);
921924
})
922925
}
923926

@@ -1001,6 +1004,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
10011004
fn visit_block(&mut self, b: &ast::Block) {
10021005
run_lints!(self, check_block, early_passes, b);
10031006
ast_visit::walk_block(self, b);
1007+
run_lints!(self, check_block_post, early_passes, b);
10041008
}
10051009

10061010
fn visit_arm(&mut self, a: &ast::Arm) {
@@ -1253,6 +1257,8 @@ pub fn check_crate(tcx: &ty::ctxt, access_levels: &AccessLevels) {
12531257
run_lints!(cx, check_crate, late_passes, krate);
12541258

12551259
hir_visit::walk_crate(cx, krate);
1260+
1261+
run_lints!(cx, check_crate_post, late_passes, krate);
12561262
});
12571263

12581264
// If we missed any lints added to the session, then there's a bug somewhere
@@ -1284,6 +1290,8 @@ pub fn check_ast_crate(sess: &Session, krate: &ast::Crate) {
12841290
run_lints!(cx, check_crate, early_passes, krate);
12851291

12861292
ast_visit::walk_crate(cx, krate);
1293+
1294+
run_lints!(cx, check_crate_post, early_passes, krate);
12871295
});
12881296

12891297
// Put the lint store back in the session.

branches/stable/src/librustc/lint/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,14 @@ pub trait LintPass {
132132
pub trait LateLintPass: LintPass {
133133
fn check_name(&mut self, _: &LateContext, _: Span, _: ast::Name) { }
134134
fn check_crate(&mut self, _: &LateContext, _: &hir::Crate) { }
135+
fn check_crate_post(&mut self, _: &LateContext, _: &hir::Crate) { }
135136
fn check_mod(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { }
136137
fn check_foreign_item(&mut self, _: &LateContext, _: &hir::ForeignItem) { }
137138
fn check_item(&mut self, _: &LateContext, _: &hir::Item) { }
139+
fn check_item_post(&mut self, _: &LateContext, _: &hir::Item) { }
138140
fn check_local(&mut self, _: &LateContext, _: &hir::Local) { }
139141
fn check_block(&mut self, _: &LateContext, _: &hir::Block) { }
142+
fn check_block_post(&mut self, _: &LateContext, _: &hir::Block) { }
140143
fn check_stmt(&mut self, _: &LateContext, _: &hir::Stmt) { }
141144
fn check_arm(&mut self, _: &LateContext, _: &hir::Arm) { }
142145
fn check_pat(&mut self, _: &LateContext, _: &hir::Pat) { }
@@ -174,11 +177,14 @@ pub trait LateLintPass: LintPass {
174177
pub trait EarlyLintPass: LintPass {
175178
fn check_ident(&mut self, _: &EarlyContext, _: Span, _: ast::Ident) { }
176179
fn check_crate(&mut self, _: &EarlyContext, _: &ast::Crate) { }
180+
fn check_crate_post(&mut self, _: &EarlyContext, _: &ast::Crate) { }
177181
fn check_mod(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
178182
fn check_foreign_item(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
179183
fn check_item(&mut self, _: &EarlyContext, _: &ast::Item) { }
184+
fn check_item_post(&mut self, _: &EarlyContext, _: &ast::Item) { }
180185
fn check_local(&mut self, _: &EarlyContext, _: &ast::Local) { }
181186
fn check_block(&mut self, _: &EarlyContext, _: &ast::Block) { }
187+
fn check_block_post(&mut self, _: &EarlyContext, _: &ast::Block) { }
182188
fn check_stmt(&mut self, _: &EarlyContext, _: &ast::Stmt) { }
183189
fn check_arm(&mut self, _: &EarlyContext, _: &ast::Arm) { }
184190
fn check_pat(&mut self, _: &EarlyContext, _: &ast::Pat) { }

branches/stable/src/librustc/middle/infer/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ pub struct InferCtxt<'a, 'tcx: 'a> {
8888

8989
pub parameter_environment: ty::ParameterEnvironment<'a, 'tcx>,
9090

91-
pub fulfillment_cx: RefCell<traits::FulfillmentContext<'tcx>>,
92-
9391
// the set of predicates on which errors have been reported, to
9492
// avoid reporting the same error twice.
9593
pub reported_trait_errors: RefCell<FnvHashSet<traits::TraitErrorKey<'tcx>>>,
@@ -366,7 +364,6 @@ pub fn new_infer_ctxt<'a, 'tcx>(tcx: &'a ty::ctxt<'tcx>,
366364
float_unification_table: RefCell::new(UnificationTable::new()),
367365
region_vars: RegionVarBindings::new(tcx),
368366
parameter_environment: param_env.unwrap_or(tcx.empty_parameter_environment()),
369-
fulfillment_cx: RefCell::new(traits::FulfillmentContext::new()),
370367
reported_trait_errors: RefCell::new(FnvHashSet()),
371368
normalize: false,
372369
err_count_on_creation: tcx.sess.err_count()
@@ -525,7 +522,7 @@ pub fn normalize_associated_type<'tcx,T>(tcx: &ty::ctxt<'tcx>, value: &T) -> T
525522
result,
526523
obligations);
527524

528-
let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
525+
let mut fulfill_cx = traits::FulfillmentContext::new();
529526

530527
for obligation in obligations {
531528
fulfill_cx.register_predicate_obligation(&infcx, obligation);

0 commit comments

Comments
 (0)