Skip to content

Commit d6c8dde

Browse files
committed
Merge branch 'master' into clippy-libcollections
2 parents 70deac1 + 38c53f3 commit d6c8dde

File tree

250 files changed

+2519
-1511
lines changed

Some content is hidden

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

250 files changed

+2519
-1511
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
url = https://github.com/rust-lang/libc.git
2121
[submodule "src/doc/nomicon"]
2222
path = src/doc/nomicon
23-
url = https://github.com/rust-lang-nursery/nomicon
23+
url = https://github.com/rust-lang-nursery/nomicon.git
2424
[submodule "src/tools/cargo"]
2525
path = cargo
26-
url = https://github.com/rust-lang/cargo
26+
url = https://github.com/rust-lang/cargo.git
2727
[submodule "reference"]
2828
path = src/doc/reference
2929
url = https://github.com/rust-lang-nursery/reference.git

.travis.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ matrix:
4848
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
4949
SCCACHE_ERROR_LOG=/tmp/sccache.log
5050
RUST_LOG=sccache=debug
51+
MACOSX_DEPLOYMENT_TARGET=10.8
52+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
5153
os: osx
5254
osx_image: xcode8.2
5355
install: &osx_install_sccache >
54-
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-apple-darwin &&
56+
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-apple-darwin &&
5557
chmod +x /usr/local/bin/sccache
5658
- env: >
5759
RUST_CHECK_TARGET=check
@@ -60,6 +62,8 @@ matrix:
6062
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
6163
SCCACHE_ERROR_LOG=/tmp/sccache.log
6264
RUST_LOG=sccache=debug
65+
MACOSX_DEPLOYMENT_TARGET=10.8
66+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
6367
os: osx
6468
osx_image: xcode8.2
6569
install: *osx_install_sccache
@@ -72,10 +76,12 @@ matrix:
7276
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
7377
SCCACHE_ERROR_LOG=/tmp/sccache.log
7478
RUST_LOG=sccache=debug
79+
MACOSX_DEPLOYMENT_TARGET=10.8
80+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
7581
os: osx
7682
osx_image: xcode8.2
7783
install: >
78-
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-apple-darwin &&
84+
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-apple-darwin &&
7985
chmod +x /usr/local/bin/sccache
8086
- env: >
8187
RUST_CHECK_TARGET=dist
@@ -85,6 +91,8 @@ matrix:
8591
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
8692
SCCACHE_ERROR_LOG=/tmp/sccache.log
8793
RUST_LOG=sccache=debug
94+
MACOSX_DEPLOYMENT_TARGET=10.8
95+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
8896
os: osx
8997
osx_image: xcode8.2
9098
install: *osx_install_sccache
@@ -102,6 +110,8 @@ matrix:
102110
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
103111
SCCACHE_ERROR_LOG=/tmp/sccache.log
104112
RUST_LOG=sccache=debug
113+
MACOSX_DEPLOYMENT_TARGET=10.8
114+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
105115
os: osx
106116
osx_image: xcode8.2
107117
install: *osx_install_sccache

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ If you’d like to build the documentation, it’s almost the same:
161161
$ ./x.py doc
162162
```
163163

164-
The generated documentation will appear in a top-level `doc` directory,
165-
created by the `make` rule.
164+
The generated documentation will appear under `doc` in the `build` directory for
165+
the ABI used. I.e., if the ABI was `x86_64-pc-windows-msvc`, the directory will be
166+
`build\x86_64-pc-windows-msvc\doc`.
166167

167168
## Notes
168169

RELEASES.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Version 1.16.0 (2017-03-16)
44
Language
55
--------
66

7-
* Lifetimes in statics and consts default to `'static`. [RFC 1623]
87
* [The compiler's `dead_code` lint now accounts for type aliases][38051].
98
* [Uninhabitable enums (those without any variants) no longer permit wildcard
109
match patterns][38069]
@@ -5056,7 +5055,7 @@ Version 0.1 (2012-01-20)
50565055

50575056
* Compiler works with the following configurations:
50585057
* Linux: x86 and x86_64 hosts and targets
5059-
* MacOS: x86 and x86_64 hosts and targets
5058+
* macOS: x86 and x86_64 hosts and targets
50605059
* Windows: x86 hosts and targets
50615060

50625061
* Cross compilation / multi-target configuration supported.

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ install:
115115
- set PATH=C:\Python27;%PATH%
116116

117117
# Download and install sccache
118-
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-pc-windows-msvc
119-
- mv 2017-02-25-sccache-x86_64-pc-windows-msvc sccache
118+
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-pc-windows-msvc
119+
- mv 2017-03-16-sccache-x86_64-pc-windows-msvc sccache
120120
- set PATH=%PATH%;%CD%
121121

122122
# Install InnoSetup to get `iscc` used to produce installers

configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ opt dist-host-only 0 "only install bins for the host architecture"
445445
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
446446
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
447447
opt codegen-tests 1 "run the src/test/codegen tests"
448+
opt save-analysis 0 "save API analysis data"
448449
opt option-checking 1 "complain about unrecognized options in this configure script"
449450
opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
450451
opt locked-deps 0 "force Cargo.lock to be up to date"

src/bootstrap/bin/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn main() {
182182
if env::var("RUSTC_RPATH") == Ok("true".to_string()) {
183183
let rpath = if target.contains("apple") {
184184

185-
// Note that we need to take one extra step on OSX to also pass
185+
// Note that we need to take one extra step on macOS to also pass
186186
// `-Wl,-instal_name,@rpath/...` to get things to work right. To
187187
// do that we pass a weird flag to the compiler to get it to do
188188
// so. Note that this is definitely a hack, and we should likely

src/bootstrap/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub fn compiletest(build: &Build,
176176
cmd.arg("--docck-python").arg(build.python());
177177

178178
if build.config.build.ends_with("apple-darwin") {
179-
// Force /usr/bin/python on OSX for LLDB tests because we're loading the
179+
// Force /usr/bin/python on macOS for LLDB tests because we're loading the
180180
// LLDB plugin's compiled module which only works with the system python
181181
// (namely not Homebrew-installed python)
182182
cmd.arg("--lldb-python").arg("/usr/bin/python");

src/bootstrap/clean.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ use std::path::Path;
2222
use Build;
2323

2424
pub fn clean(build: &Build) {
25-
rm_rf(build, "tmp".as_ref());
26-
rm_rf(build, &build.out.join("tmp"));
27-
rm_rf(build, &build.out.join("dist"));
25+
rm_rf("tmp".as_ref());
26+
rm_rf(&build.out.join("tmp"));
27+
rm_rf(&build.out.join("dist"));
2828

2929
for host in build.config.host.iter() {
3030
let entries = match build.out.join(host).read_dir() {
@@ -38,12 +38,12 @@ pub fn clean(build: &Build) {
3838
continue
3939
}
4040
let path = t!(entry.path().canonicalize());
41-
rm_rf(build, &path);
41+
rm_rf(&path);
4242
}
4343
}
4444
}
4545

46-
fn rm_rf(build: &Build, path: &Path) {
46+
fn rm_rf(path: &Path) {
4747
if !path.exists() {
4848
return
4949
}
@@ -55,7 +55,7 @@ fn rm_rf(build: &Build, path: &Path) {
5555
let file = t!(file).path();
5656

5757
if file.is_dir() {
58-
rm_rf(build, &file);
58+
rm_rf(&file);
5959
} else {
6060
// On windows we can't remove a readonly file, and git will
6161
// often clone files as readonly. As a result, we have some

src/bootstrap/compile.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::collections::HashMap;
2020
use std::fs::{self, File};
2121
use std::path::{Path, PathBuf};
2222
use std::process::Command;
23+
use std::env;
2324

2425
use build_helper::{output, mtime, up_to_date};
2526
use filetime::FileTime;
@@ -44,6 +45,11 @@ pub fn std(build: &Build, target: &str, compiler: &Compiler) {
4445
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
4546
let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build");
4647
let mut features = build.std_features();
48+
49+
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
50+
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
51+
}
52+
4753
// When doing a local rebuild we tell cargo that we're stage1 rather than
4854
// stage0. This works fine if the local rust and being-built rust have the
4955
// same view of what the default allocator is, but fails otherwise. Since
@@ -170,6 +176,9 @@ pub fn test(build: &Build, target: &str, compiler: &Compiler) {
170176
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
171177
build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target));
172178
let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build");
179+
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
180+
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
181+
}
173182
cargo.arg("--manifest-path")
174183
.arg(build.src.join("src/libtest/Cargo.toml"));
175184
build.run(&mut cargo);
@@ -249,7 +258,7 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
249258
cargo.env("CFG_LLVM_ROOT", s);
250259
}
251260
// Building with a static libstdc++ is only supported on linux right now,
252-
// not for MSVC or OSX
261+
// not for MSVC or macOS
253262
if build.config.llvm_static_stdcpp &&
254263
!target.contains("windows") &&
255264
!target.contains("apple") {

src/bootstrap/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ pub struct Config {
7474
pub rustc_default_ar: Option<String>,
7575
pub rust_optimize_tests: bool,
7676
pub rust_debuginfo_tests: bool,
77+
pub rust_save_analysis: bool,
7778
pub rust_dist_src: bool,
7879

7980
pub build: String,
@@ -225,6 +226,7 @@ struct Rust {
225226
optimize_tests: Option<bool>,
226227
debuginfo_tests: Option<bool>,
227228
codegen_tests: Option<bool>,
229+
save_analysis: Option<bool>,
228230
}
229231

230232
/// TOML representation of how each build target is configured.
@@ -350,6 +352,7 @@ impl Config {
350352
set(&mut config.rust_optimize_tests, rust.optimize_tests);
351353
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
352354
set(&mut config.codegen_tests, rust.codegen_tests);
355+
set(&mut config.rust_save_analysis, rust.save_analysis);
353356
set(&mut config.rust_rpath, rust.rpath);
354357
set(&mut config.debug_jemalloc, rust.debug_jemalloc);
355358
set(&mut config.use_jemalloc, rust.use_jemalloc);
@@ -457,6 +460,7 @@ impl Config {
457460
("LOCAL_REBUILD", self.local_rebuild),
458461
("NINJA", self.ninja),
459462
("CODEGEN_TESTS", self.codegen_tests),
463+
("SAVE_ANALYSIS", self.rust_save_analysis),
460464
("LOCKED_DEPS", self.locked_deps),
461465
("VENDOR", self.vendor),
462466
("FULL_BOOTSTRAP", self.full_bootstrap),

src/bootstrap/config.toml.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@
234234
# saying that the FileCheck executable is missing, you may want to disable this.
235235
#codegen-tests = true
236236

237+
# Flag indicating whether the API analysis data should be saved.
238+
#save-analysis = false
239+
237240
# =============================================================================
238241
# Options for specific targets
239242
#

src/bootstrap/dist.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,14 @@ pub fn rust_src_location(build: &Build) -> PathBuf {
311311

312312
/// Creates a tarball of save-analysis metadata, if available.
313313
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
314+
if !build.config.rust_save_analysis {
315+
return
316+
}
317+
314318
println!("Dist analysis");
315319

316-
if build.config.channel != "nightly" {
317-
println!("\tskipping - not on nightly channel");
318-
return;
319-
}
320320
if compiler.host != build.config.build {
321-
println!("\tskipping - not a build host");
322-
return
323-
}
324-
if compiler.stage != 2 {
325-
println!("\tskipping - not stage2");
321+
println!("\tskipping, not a build host");
326322
return
327323
}
328324

src/bootstrap/install.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ pub fn install(build: &Build, stage: u32, host: &str) {
4949
install_sh(&build, "docs", "rust-docs", stage, host, &prefix,
5050
&docdir, &libdir, &mandir, &empty_dir);
5151
}
52+
if build.config.rust_save_analysis {
53+
install_sh(&build, "analysis", "rust-analysis", stage, host, &prefix,
54+
&docdir, &libdir, &mandir, &empty_dir);
55+
}
5256
install_sh(&build, "std", "rust-std", stage, host, &prefix,
5357
&docdir, &libdir, &mandir, &empty_dir);
5458
install_sh(&build, "rustc", "rustc", stage, host, &prefix,

src/bootstrap/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl Build {
524524
.env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
525525
}
526526

527-
if self.config.channel == "nightly" && compiler.is_final_stage(self) {
527+
if self.config.rust_save_analysis && compiler.is_final_stage(self) {
528528
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
529529
}
530530

@@ -846,7 +846,7 @@ impl Build {
846846
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
847847
.collect::<Vec<_>>();
848848

849-
// If we're compiling on OSX then we add a few unconditional flags
849+
// If we're compiling on macOS then we add a few unconditional flags
850850
// indicating that we want libc++ (more filled out than libstdc++) and
851851
// we want to compile for 10.7. This way we can ensure that
852852
// LLVM/jemalloc/etc are all properly compiled.

src/bootstrap/native.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,24 @@ pub fn openssl(build: &Build, target: &str) {
222222
let tarball = out.join(&name);
223223
if !tarball.exists() {
224224
let tmp = tarball.with_extension("tmp");
225-
build.run(Command::new("curl")
226-
.arg("-o").arg(&tmp)
227-
.arg(format!("https://www.openssl.org/source/{}", name)));
225+
// originally from https://www.openssl.org/source/...
226+
let url = format!("https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/{}",
227+
name);
228+
let mut ok = false;
229+
for _ in 0..3 {
230+
let status = Command::new("curl")
231+
.arg("-o").arg(&tmp)
232+
.arg(&url)
233+
.status()
234+
.expect("failed to spawn curl");
235+
if status.success() {
236+
ok = true;
237+
break
238+
}
239+
}
240+
if !ok {
241+
panic!("failed to download openssl source")
242+
}
228243
let mut shasum = if target.contains("apple") {
229244
let mut cmd = Command::new("shasum");
230245
cmd.arg("-a").arg("256");

src/bootstrap/sanity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ pub fn check(build: &mut Build) {
151151
}
152152

153153
for target in build.config.target.iter() {
154-
// Can't compile for iOS unless we're on OSX
154+
// Can't compile for iOS unless we're on macOS
155155
if target.contains("apple-ios") &&
156156
!build.config.build.contains("apple-darwin") {
157-
panic!("the iOS target is only supported on OSX");
157+
panic!("the iOS target is only supported on macOS");
158158
}
159159

160160
// Make sure musl-root is valid if specified

src/ci/docker/armhf-gnu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
7474
RUN curl -O http://ftp.nl.debian.org/debian/dists/jessie/main/installer-armhf/current/images/device-tree/vexpress-v2p-ca15-tc1.dtb
7575

7676
RUN curl -o /usr/local/bin/sccache \
77-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
77+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
7878
chmod +x /usr/local/bin/sccache
7979

8080
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \

src/ci/docker/cross/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2222
pkg-config
2323

2424
RUN curl -o /usr/local/bin/sccache \
25-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
25+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
2626
chmod +x /usr/local/bin/sccache
2727

2828
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \

src/ci/docker/dist-android/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
3232
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
3333

3434
RUN curl -o /usr/local/bin/sccache \
35-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
35+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
3636
chmod +x /usr/local/bin/sccache
3737

3838
ENV TARGETS=arm-linux-androideabi

src/ci/docker/dist-arm-linux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2828
pkg-config
2929

3030
RUN curl -o /usr/local/bin/sccache \
31-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
31+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
3232
chmod +x /usr/local/bin/sccache
3333

3434
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \

src/ci/docker/dist-armv7-aarch64-linux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2828
pkg-config
2929

3030
RUN curl -o /usr/local/bin/sccache \
31-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
31+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
3232
chmod +x /usr/local/bin/sccache
3333

3434
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \

0 commit comments

Comments
 (0)