Skip to content

Commit b4a1729

Browse files
committed
---
yaml --- r: 274905 b: refs/heads/stable c: 9d98390 h: refs/heads/master i: 274903: 8d83809
1 parent 7aa71db commit b4a1729

File tree

163 files changed

+2402
-566
lines changed

Some content is hidden

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

163 files changed

+2402
-566
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: 9f414a44a747edc7dc229e0eaf6fbda5e6ea10e1
32+
refs/heads/stable: 9d98390765bbe61ce2a39b40c99ae1a68bb6d1cc
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*.elc
1818
*.epub
1919
*.exe
20+
*.pdb
2021
*.fn
2122
*.html
2223
*.kdev4
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/doc/uptack.tex

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

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

branches/stable/src/librustc/middle/traits/fulfill.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'tcx> FulfillmentContext<'tcx> {
133133
cause: ObligationCause<'tcx>)
134134
-> Ty<'tcx>
135135
{
136-
debug!("normalize_associated_type(projection_ty={:?})",
136+
debug!("normalize_projection_type(projection_ty={:?})",
137137
projection_ty);
138138

139139
assert!(!projection_ty.has_escaping_regions());
@@ -147,7 +147,7 @@ impl<'tcx> FulfillmentContext<'tcx> {
147147
self.register_predicate_obligation(infcx, obligation);
148148
}
149149

150-
debug!("normalize_associated_type: result={:?}", normalized.value);
150+
debug!("normalize_projection_type: result={:?}", normalized.value);
151151

152152
normalized.value
153153
}
@@ -185,11 +185,11 @@ impl<'tcx> FulfillmentContext<'tcx> {
185185
assert!(!obligation.has_escaping_regions());
186186

187187
if self.is_duplicate_or_add(infcx.tcx, &obligation.predicate) {
188-
debug!("register_predicate({:?}) -- already seen, skip", obligation);
188+
debug!("register_predicate_obligation({:?}) -- already seen, skip", obligation);
189189
return;
190190
}
191191

192-
debug!("register_predicate({:?})", obligation);
192+
debug!("register_predicate_obligation({:?})", obligation);
193193
let obligation = PendingPredicateObligation {
194194
obligation: obligation,
195195
stalled_on: vec![]
@@ -274,7 +274,7 @@ impl<'tcx> FulfillmentContext<'tcx> {
274274
let mut errors = Vec::new();
275275

276276
loop {
277-
debug!("select_where_possible: starting another iteration");
277+
debug!("select: starting another iteration");
278278

279279
// Process pending obligations.
280280
let outcome = {
@@ -287,7 +287,7 @@ impl<'tcx> FulfillmentContext<'tcx> {
287287
region_obligations))
288288
};
289289

290-
debug!("select_where_possible: outcome={:?}", outcome);
290+
debug!("select: outcome={:?}", outcome);
291291

292292
// these are obligations that were proven to be true.
293293
for pending_obligation in outcome.completed {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2014 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 target::Target;
12+
13+
pub fn target() -> Target {
14+
let mut base = super::linux_base::opts();
15+
base.cpu = "pentium".to_string();
16+
base.pre_link_args.push("-m32".to_string());
17+
18+
Target {
19+
llvm_target: "i586-unknown-linux-gnu".to_string(),
20+
target_endian: "little".to_string(),
21+
target_pointer_width: "32".to_string(),
22+
arch: "x86".to_string(),
23+
target_os: "linux".to_string(),
24+
target_env: "gnu".to_string(),
25+
target_vendor: "unknown".to_string(),
26+
options: base,
27+
}
28+
}

branches/stable/src/librustc_back/target/i686_pc_windows_msvc.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ pub fn target() -> Target {
1414
let mut base = super::windows_msvc_base::opts();
1515
base.cpu = "pentium4".to_string();
1616

17+
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
18+
// space available to x86 Windows binaries on x86_64.
19+
base.pre_link_args.push("/LARGEADDRESSAWARE".to_string());
20+
21+
// Ensure the linker will only produce an image if it can also produce a table of
22+
// the image's safe exception handlers.
23+
// https://msdn.microsoft.com/en-us/library/9a89h429.aspx
24+
base.pre_link_args.push("/SAFESEH".to_string());
25+
1726
Target {
1827
llvm_target: "i686-pc-windows-msvc".to_string(),
1928
target_endian: "little".to_string(),

branches/stable/src/librustc_back/target/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ macro_rules! supported_targets {
8989
supported_targets! {
9090
("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
9191
("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
92+
("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
9293
("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
9394
("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
9495
("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),

0 commit comments

Comments
 (0)