diff --git a/.gitmodules b/.gitmodules index 9003f0750a231..7cd896b763f54 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,15 +22,14 @@ path = src/doc/nomicon url = /~https://github.com/rust-lang-nursery/nomicon.git [submodule "src/tools/cargo"] - path = cargo - url = /~https://github.com/rust-lang/cargo.git + path = src/tools/cargo + url = /~https://github.com/rust-lang/cargo [submodule "reference"] path = src/doc/reference url = /~https://github.com/rust-lang-nursery/reference.git [submodule "book"] path = src/doc/book url = /~https://github.com/rust-lang/book.git -[submodule "rls"] - path = rls - url = /~https://github.com/rust-lang-nursery/rls.git - +[submodule "src/tools/rls"] + path = src/tools/rls + url = /~https://github.com/rust-lang-nursery/rls diff --git a/.travis.yml b/.travis.yml index c5372609e9bc6..530ae4aa65cc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ matrix: os: osx osx_image: xcode8.2 install: &osx_install_sccache > - travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-apple-darwin && + travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-apple-darwin && chmod +x /usr/local/bin/sccache && travis_retry curl -o /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin && chmod +x /usr/local/bin/stamp diff --git a/appveyor.yml b/appveyor.yml index c662ba0360254..7f9ba5a057f53 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,14 +32,14 @@ environment: # came from the mingw-w64 SourceForge download site. Unfortunately # SourceForge is notoriously flaky, so we mirror it on our own infrastructure. - MSYS_BITS: 32 - RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-ninja + RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu SCRIPT: python x.py test MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z MINGW_DIR: mingw32 - MSYS_BITS: 64 SCRIPT: python x.py test - RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-ninja + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z MINGW_DIR: mingw64 @@ -57,7 +57,7 @@ environment: SCRIPT: python x.py dist DEPLOY: 1 - MSYS_BITS: 32 - RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended --enable-ninja + RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended SCRIPT: python x.py dist MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z @@ -65,7 +65,7 @@ environment: DEPLOY: 1 - MSYS_BITS: 64 SCRIPT: python x.py dist - RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended --enable-ninja + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z MINGW_DIR: mingw64 @@ -124,8 +124,8 @@ install: - set PATH=C:\Python27;%PATH% # Download and install sccache - - appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-pc-windows-msvc - - mv 2017-04-04-sccache-x86_64-pc-windows-msvc sccache.exe + - appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-pc-windows-msvc + - mv 2017-04-19-sccache-x86_64-pc-windows-msvc sccache.exe - set PATH=%PATH%;%CD% # Download and install ninja @@ -133,6 +133,7 @@ install: # Note that this is originally from the github releases patch of Ninja - appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-15-ninja-win.zip - 7z x 2017-03-15-ninja-win.zip + - set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --enable-ninja # - set PATH=%PATH%;%CD% -- this already happens above for sccache # Install InnoSetup to get `iscc` used to produce installers @@ -159,12 +160,6 @@ test_script: on_failure: - cat %CD%\sccache.log || exit 0 -cache: - - "build/i686-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger" - - "build/x86_64-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger" - - "i686-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger" - - "x86_64-pc-windows-msvc/llvm -> src/rustllvm/llvm-rebuild-trigger" - branches: only: - auto diff --git a/cargo b/cargo deleted file mode 160000 index 03efb7fc8b0db..0000000000000 --- a/cargo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 03efb7fc8b0dbb54973ee1b6188f3faf14fffe36 diff --git a/rls b/rls deleted file mode 160000 index 6ecff95fdc3ee..0000000000000 --- a/rls +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6ecff95fdc3ee7ceed2b9b0cc1a3a64876860bce diff --git a/src/Cargo.toml b/src/Cargo.toml index 0dafbb8428e3e..fbfe9129b7a03 100644 --- a/src/Cargo.toml +++ b/src/Cargo.toml @@ -15,6 +15,12 @@ members = [ "tools/qemu-test-server", ] +# These projects have their own Cargo.lock +exclude = [ + "tools/cargo", + "tools/rls", +] + # Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit # MSVC when running the compile-fail test suite when a should-fail test panics. # But hey if this is removed and it gets past the bots, sounds good to me. diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index ecfddec328cd1..1088067c2de57 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -23,6 +23,11 @@ name = "rustdoc" path = "bin/rustdoc.rs" test = false +[[bin]] +name = "sccache-plus-cl" +path = "bin/sccache-plus-cl.rs" +test = false + [dependencies] build_helper = { path = "../build_helper" } cmake = "0.1.17" diff --git a/src/bootstrap/bin/sccache-plus-cl.rs b/src/bootstrap/bin/sccache-plus-cl.rs new file mode 100644 index 0000000000000..cf0c12749234c --- /dev/null +++ b/src/bootstrap/bin/sccache-plus-cl.rs @@ -0,0 +1,43 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate gcc; + +use std::env; +use std::process::{self, Command}; + +fn main() { + let target = env::var("SCCACHE_TARGET").unwrap(); + // Locate the actual compiler that we're invoking + env::remove_var("CC"); + env::remove_var("CXX"); + let mut cfg = gcc::Config::new(); + cfg.cargo_metadata(false) + .out_dir("/") + .target(&target) + .host(&target) + .opt_level(0) + .debug(false); + let compiler = cfg.get_compiler(); + + // Invoke sccache with said compiler + let sccache_path = env::var_os("SCCACHE_PATH").unwrap(); + let mut cmd = Command::new(&sccache_path); + cmd.arg(compiler.path()); + for &(ref k, ref v) in compiler.env() { + cmd.env(k, v); + } + for arg in env::args().skip(1) { + cmd.arg(arg); + } + + let status = cmd.status().expect("failed to spawn"); + process::exit(status.code().unwrap_or(2)) +} diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index e5f8143b41871..2bccdef9b0ac4 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -159,19 +159,20 @@ def format_build_time(duration): class RustBuild(object): def download_stage0(self): cache_dst = os.path.join(self.build_dir, "cache") - rustc_cache = os.path.join(cache_dst, self.stage0_rustc_date()) + rustc_cache = os.path.join(cache_dst, self.stage0_date()) if not os.path.exists(rustc_cache): os.makedirs(rustc_cache) - channel = self.stage0_rustc_channel() + rustc_channel = self.stage0_rustc_channel() + cargo_channel = self.stage0_cargo_channel() if self.rustc().startswith(self.bin_root()) and \ (not os.path.exists(self.rustc()) or self.rustc_out_of_date()): self.print_what_it_means_to_bootstrap() if os.path.exists(self.bin_root()): shutil.rmtree(self.bin_root()) - filename = "rust-std-{}-{}.tar.gz".format(channel, self.build) - url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date() + filename = "rust-std-{}-{}.tar.gz".format(rustc_channel, self.build) + url = self._download_url + "/dist/" + self.stage0_date() tarball = os.path.join(rustc_cache, filename) if not os.path.exists(tarball): get("{}/{}".format(url, filename), tarball, verbose=self.verbose) @@ -179,8 +180,8 @@ def download_stage0(self): match="rust-std-" + self.build, verbose=self.verbose) - filename = "rustc-{}-{}.tar.gz".format(channel, self.build) - url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date() + filename = "rustc-{}-{}.tar.gz".format(rustc_channel, self.build) + url = self._download_url + "/dist/" + self.stage0_date() tarball = os.path.join(rustc_cache, filename) if not os.path.exists(tarball): get("{}/{}".format(url, filename), tarball, verbose=self.verbose) @@ -188,11 +189,11 @@ def download_stage0(self): self.fix_executable(self.bin_root() + "/bin/rustc") self.fix_executable(self.bin_root() + "/bin/rustdoc") with open(self.rustc_stamp(), 'w') as f: - f.write(self.stage0_rustc_date()) + f.write(self.stage0_date()) if "pc-windows-gnu" in self.build: - filename = "rust-mingw-{}-{}.tar.gz".format(channel, self.build) - url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date() + filename = "rust-mingw-{}-{}.tar.gz".format(rustc_channel, self.build) + url = self._download_url + "/dist/" + self.stage0_date() tarball = os.path.join(rustc_cache, filename) if not os.path.exists(tarball): get("{}/{}".format(url, filename), tarball, verbose=self.verbose) @@ -201,15 +202,15 @@ def download_stage0(self): if self.cargo().startswith(self.bin_root()) and \ (not os.path.exists(self.cargo()) or self.cargo_out_of_date()): self.print_what_it_means_to_bootstrap() - filename = "cargo-{}-{}.tar.gz".format(channel, self.build) - url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date() + filename = "cargo-{}-{}.tar.gz".format(cargo_channel, self.build) + url = self._download_url + "/dist/" + self.stage0_date() tarball = os.path.join(rustc_cache, filename) if not os.path.exists(tarball): get("{}/{}".format(url, filename), tarball, verbose=self.verbose) unpack(tarball, self.bin_root(), match="cargo", verbose=self.verbose) self.fix_executable(self.bin_root() + "/bin/cargo") with open(self.cargo_stamp(), 'w') as f: - f.write(self.stage0_rustc_date()) + f.write(self.stage0_date()) def fix_executable(self, fname): # If we're on NixOS we need to change the path to the dynamic loader @@ -264,12 +265,15 @@ def fix_executable(self, fname): print("warning: failed to call patchelf: %s" % e) return - def stage0_rustc_date(self): - return self._rustc_date + def stage0_date(self): + return self._date def stage0_rustc_channel(self): return self._rustc_channel + def stage0_cargo_channel(self): + return self._cargo_channel + def rustc_stamp(self): return os.path.join(self.bin_root(), '.rustc-stamp') @@ -280,13 +284,13 @@ def rustc_out_of_date(self): if not os.path.exists(self.rustc_stamp()) or self.clean: return True with open(self.rustc_stamp(), 'r') as f: - return self.stage0_rustc_date() != f.read() + return self.stage0_date() != f.read() def cargo_out_of_date(self): if not os.path.exists(self.cargo_stamp()) or self.clean: return True with open(self.cargo_stamp(), 'r') as f: - return self.stage0_rustc_date() != f.read() + return self.stage0_date() != f.read() def bin_root(self): return os.path.join(self.build_dir, self.build, "stage0") @@ -585,7 +589,13 @@ def bootstrap(): shutil.rmtree('.cargo') data = stage0_data(rb.rust_root) - rb._rustc_channel, rb._rustc_date = data['rustc'].split('-', 1) + rb._date = data['date'] + rb._rustc_channel = data['rustc'] + rb._cargo_channel = data['cargo'] + if 'dev' in data: + rb._download_url = 'https://dev-static.rust-lang.org' + else: + rb._download_url = 'https://static.rust-lang.org' # Fetch/build the bootstrap rb.build = rb.build_triple() diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index a95bdcb3d2608..1b9536fba357a 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -23,7 +23,7 @@ use build_helper::output; use Build; // The version number -pub const CFG_RELEASE_NUM: &'static str = "1.18.0"; +pub const CFG_RELEASE_NUM: &'static str = "1.19.0"; // An optional number to put after the label, e.g. '.2' -> '-beta.2' // Be sure to make this starts with a dot to conform to semver pre-release diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 6f1de62d07ee3..c810a0e05d4d2 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -461,10 +461,7 @@ pub fn tool(build: &Build, stage: u32, target: &str, tool: &str) { let compiler = Compiler::new(stage, &build.config.build); let mut cargo = build.cargo(&compiler, Mode::Tool, target, "build"); - let mut dir = build.src.join(tool); - if !dir.exists() { - dir = build.src.join("src/tools").join(tool); - } + let dir = build.src.join("src/tools").join(tool); cargo.arg("--manifest-path").arg(dir.join("Cargo.toml")); // We don't want to build tools dynamically as they'll be running across diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index bbfab38895004..e3a2d0b51d3f1 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -234,8 +234,8 @@ impl Build { None => false, }; let rust_info = channel::GitInfo::new(&src); - let cargo_info = channel::GitInfo::new(&src.join("cargo")); - let rls_info = channel::GitInfo::new(&src.join("rls")); + let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo")); + let rls_info = channel::GitInfo::new(&src.join("src/tools/rls")); let src_is_git = src.join(".git").exists(); Build { diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index c0b8a9f1ef666..3d87f701b2a56 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -19,6 +19,7 @@ //! ensure that they're always in place if needed. use std::env; +use std::ffi::OsString; use std::fs::{self, File}; use std::io::{Read, Write}; use std::path::Path; @@ -129,22 +130,56 @@ pub fn llvm(build: &Build, target: &str) { .define("LLVM_TABLEGEN", &host); } - // MSVC handles compiler business itself - if !target.contains("msvc") { - if let Some(ref ccache) = build.config.ccache { + let sanitize_cc = |cc: &Path| { + if target.contains("msvc") { + OsString::from(cc.to_str().unwrap().replace("\\", "/")) + } else { + cc.as_os_str().to_owned() + } + }; + + let configure_compilers = |cfg: &mut cmake::Config| { + // MSVC with CMake uses msbuild by default which doesn't respect these + // vars that we'd otherwise configure. In that case we just skip this + // entirely. + if target.contains("msvc") && !build.config.ninja { + return + } + + let cc = build.cc(target); + let cxx = build.cxx(target); + + // Handle msvc + ninja + ccache specially (this is what the bots use) + if target.contains("msvc") && + build.config.ninja && + build.config.ccache.is_some() { + let mut cc = env::current_exe().expect("failed to get cwd"); + cc.set_file_name("sccache-plus-cl.exe"); + + cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc)) + .define("CMAKE_CXX_COMPILER", sanitize_cc(&cc)); + cfg.env("SCCACHE_PATH", + build.config.ccache.as_ref().unwrap()) + .env("SCCACHE_TARGET", target); + + // If ccache is configured we inform the build a little differently hwo + // to invoke ccache while also invoking our compilers. + } else if let Some(ref ccache) = build.config.ccache { cfg.define("CMAKE_C_COMPILER", ccache) - .define("CMAKE_C_COMPILER_ARG1", build.cc(target)) + .define("CMAKE_C_COMPILER_ARG1", sanitize_cc(cc)) .define("CMAKE_CXX_COMPILER", ccache) - .define("CMAKE_CXX_COMPILER_ARG1", build.cxx(target)); + .define("CMAKE_CXX_COMPILER_ARG1", sanitize_cc(cxx)); } else { - cfg.define("CMAKE_C_COMPILER", build.cc(target)) - .define("CMAKE_CXX_COMPILER", build.cxx(target)); + cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc)) + .define("CMAKE_CXX_COMPILER", sanitize_cc(cxx)); } - cfg.build_arg("-j").build_arg(build.jobs().to_string()); + cfg.build_arg("-j").build_arg(build.jobs().to_string()); cfg.define("CMAKE_C_FLAGS", build.cflags(target).join(" ")); cfg.define("CMAKE_CXX_FLAGS", build.cflags(target).join(" ")); - } + }; + + configure_compilers(&mut cfg); if env::var_os("SCCACHE_ERROR_LOG").is_some() { cfg.env("RUST_LOG", "sccache=info"); diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs index d811e1122c42f..303f72085fe80 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -574,7 +574,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { .dep(|s| s.name("maybe-clean-tools")) .dep(|s| s.name("libstd-tool")) .run(move |s| compile::tool(build, s.stage, s.target, "qemu-test-client")); - rules.build("tool-cargo", "cargo") + rules.build("tool-cargo", "src/tools/cargo") .dep(|s| s.name("maybe-clean-tools")) .dep(|s| s.name("libstd-tool")) .dep(|s| s.stage(0).host(s.target).name("openssl")) @@ -586,7 +586,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { .host(&build.config.build) }) .run(move |s| compile::tool(build, s.stage, s.target, "cargo")); - rules.build("tool-rls", "rls") + rules.build("tool-rls", "src/tools/rls") .host(true) .dep(|s| s.name("librustc-tool")) .dep(|s| s.stage(0).host(s.target).name("openssl")) diff --git a/src/ci/docker/armhf-gnu/Dockerfile b/src/ci/docker/armhf-gnu/Dockerfile index d42b35d488c3d..212d14c6a80fc 100644 --- a/src/ci/docker/armhf-gnu/Dockerfile +++ b/src/ci/docker/armhf-gnu/Dockerfile @@ -74,7 +74,7 @@ RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static RUN curl -O http://ftp.nl.debian.org/debian/dists/jessie/main/installer-armhf/current/images/device-tree/vexpress-v2p-ca15-tc1.dtb RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/cross/Dockerfile b/src/ci/docker/cross/Dockerfile index 02d4eaf534acd..649b106e2ff5d 100644 --- a/src/ci/docker/cross/Dockerfile +++ b/src/ci/docker/cross/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/dist-aarch64-linux/Dockerfile b/src/ci/docker/dist-aarch64-linux/Dockerfile index d9a5429d2b8e8..1f816585afeef 100644 --- a/src/ci/docker/dist-aarch64-linux/Dockerfile +++ b/src/ci/docker/dist-aarch64-linux/Dockerfile @@ -62,7 +62,7 @@ RUN ./build-toolchains.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/aarch64-unknown-linux-gnueabi/bin diff --git a/src/ci/docker/dist-android/Dockerfile b/src/ci/docker/dist-android/Dockerfile index 28cc885ed30da..43a982c960a1c 100644 --- a/src/ci/docker/dist-android/Dockerfile +++ b/src/ci/docker/dist-android/Dockerfile @@ -32,7 +32,7 @@ RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV TARGETS=arm-linux-androideabi diff --git a/src/ci/docker/dist-arm-linux/Dockerfile b/src/ci/docker/dist-arm-linux/Dockerfile index 7162aa0efc0cf..a3837296dfa3c 100644 --- a/src/ci/docker/dist-arm-linux/Dockerfile +++ b/src/ci/docker/dist-arm-linux/Dockerfile @@ -62,7 +62,7 @@ RUN ./build-toolchains.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabi/bin diff --git a/src/ci/docker/dist-armhf-linux/Dockerfile b/src/ci/docker/dist-armhf-linux/Dockerfile index 8fa1cbe492fac..e91027bed2de9 100644 --- a/src/ci/docker/dist-armhf-linux/Dockerfile +++ b/src/ci/docker/dist-armhf-linux/Dockerfile @@ -62,7 +62,7 @@ RUN ./build-toolchains.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabihf/bin diff --git a/src/ci/docker/dist-armv7-linux/Dockerfile b/src/ci/docker/dist-armv7-linux/Dockerfile index 9fcd827fc9962..2e99507cadfd0 100644 --- a/src/ci/docker/dist-armv7-linux/Dockerfile +++ b/src/ci/docker/dist-armv7-linux/Dockerfile @@ -62,7 +62,7 @@ RUN ./build-toolchains.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/armv7-unknown-linux-gnueabihf/bin diff --git a/src/ci/docker/dist-fuchsia/Dockerfile b/src/ci/docker/dist-fuchsia/Dockerfile index 294460ed7604e..abc826f790b10 100644 --- a/src/ci/docker/dist-fuchsia/Dockerfile +++ b/src/ci/docker/dist-fuchsia/Dockerfile @@ -30,7 +30,7 @@ RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV \ diff --git a/src/ci/docker/dist-i586-gnu-i686-musl/Dockerfile b/src/ci/docker/dist-i586-gnu-i686-musl/Dockerfile index 1ef3e569cb4bf..1eafe6cf9d315 100644 --- a/src/ci/docker/dist-i586-gnu-i686-musl/Dockerfile +++ b/src/ci/docker/dist-i586-gnu-i686-musl/Dockerfile @@ -26,7 +26,7 @@ RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV RUST_CONFIGURE_ARGS \ diff --git a/src/ci/docker/dist-i686-freebsd/Dockerfile b/src/ci/docker/dist-i686-freebsd/Dockerfile index 3b81216c6431e..b94a5f4f62266 100644 --- a/src/ci/docker/dist-i686-freebsd/Dockerfile +++ b/src/ci/docker/dist-i686-freebsd/Dockerfile @@ -25,7 +25,7 @@ RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV \ diff --git a/src/ci/docker/dist-i686-linux/Dockerfile b/src/ci/docker/dist-i686-linux/Dockerfile index c25c770136f90..686060551daea 100644 --- a/src/ci/docker/dist-i686-linux/Dockerfile +++ b/src/ci/docker/dist-i686-linux/Dockerfile @@ -82,7 +82,7 @@ RUN curl -Lo /rustroot/dumb-init \ ENTRYPOINT ["/rustroot/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV HOSTS=i686-unknown-linux-gnu diff --git a/src/ci/docker/dist-mips-linux/Dockerfile b/src/ci/docker/dist-mips-linux/Dockerfile index 33cca061103a3..419dbec310bca 100644 --- a/src/ci/docker/dist-mips-linux/Dockerfile +++ b/src/ci/docker/dist-mips-linux/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/dist-mips64-linux/Dockerfile b/src/ci/docker/dist-mips64-linux/Dockerfile index 157de83abb783..d4818062e3b8e 100644 --- a/src/ci/docker/dist-mips64-linux/Dockerfile +++ b/src/ci/docker/dist-mips64-linux/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/dist-mips64el-linux/Dockerfile b/src/ci/docker/dist-mips64el-linux/Dockerfile index 739d5ff6ac4aa..2739dfb12af59 100644 --- a/src/ci/docker/dist-mips64el-linux/Dockerfile +++ b/src/ci/docker/dist-mips64el-linux/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/dist-mipsel-linux/Dockerfile b/src/ci/docker/dist-mipsel-linux/Dockerfile index 9339063bc19eb..9a36d901cf93f 100644 --- a/src/ci/docker/dist-mipsel-linux/Dockerfile +++ b/src/ci/docker/dist-mipsel-linux/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/dist-powerpc-linux/Dockerfile b/src/ci/docker/dist-powerpc-linux/Dockerfile index 92342caed2a95..ff5c66a2a5ffe 100644 --- a/src/ci/docker/dist-powerpc-linux/Dockerfile +++ b/src/ci/docker/dist-powerpc-linux/Dockerfile @@ -63,7 +63,7 @@ RUN ./build-powerpc-toolchain.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/powerpc-unknown-linux-gnu/bin diff --git a/src/ci/docker/dist-powerpc64-linux/Dockerfile b/src/ci/docker/dist-powerpc64-linux/Dockerfile index 182dfd93cc76f..2c245e1acde26 100644 --- a/src/ci/docker/dist-powerpc64-linux/Dockerfile +++ b/src/ci/docker/dist-powerpc64-linux/Dockerfile @@ -63,7 +63,7 @@ RUN ./build-powerpc64-toolchain.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/powerpc64-unknown-linux-gnu/bin diff --git a/src/ci/docker/dist-powerpc64le-linux/Dockerfile b/src/ci/docker/dist-powerpc64le-linux/Dockerfile index 6b9f964d5a383..d2fec535f4118 100644 --- a/src/ci/docker/dist-powerpc64le-linux/Dockerfile +++ b/src/ci/docker/dist-powerpc64le-linux/Dockerfile @@ -63,7 +63,7 @@ COPY shared.sh build-powerpc64le-toolchain.sh /tmp/ RUN ./build-powerpc64le-toolchain.sh RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV \ diff --git a/src/ci/docker/dist-s390x-linux/Dockerfile b/src/ci/docker/dist-s390x-linux/Dockerfile index 7c94f713e1875..2223b0c758e74 100644 --- a/src/ci/docker/dist-s390x-linux/Dockerfile +++ b/src/ci/docker/dist-s390x-linux/Dockerfile @@ -63,7 +63,7 @@ RUN ./build-s390x-toolchain.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/s390x-ibm-linux-gnu/bin diff --git a/src/ci/docker/dist-x86_64-freebsd/Dockerfile b/src/ci/docker/dist-x86_64-freebsd/Dockerfile index a2939c8c48591..289bbbdf1ddae 100644 --- a/src/ci/docker/dist-x86_64-freebsd/Dockerfile +++ b/src/ci/docker/dist-x86_64-freebsd/Dockerfile @@ -25,7 +25,7 @@ RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV \ diff --git a/src/ci/docker/dist-x86_64-linux/Dockerfile b/src/ci/docker/dist-x86_64-linux/Dockerfile index e835e8d2f7161..aef0a0ecf8cc9 100644 --- a/src/ci/docker/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/dist-x86_64-linux/Dockerfile @@ -82,7 +82,7 @@ RUN curl -Lo /rustroot/dumb-init \ ENTRYPOINT ["/rustroot/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV HOSTS=x86_64-unknown-linux-gnu diff --git a/src/ci/docker/dist-x86_64-musl/Dockerfile b/src/ci/docker/dist-x86_64-musl/Dockerfile index f462ccbb9119a..eb41e2e7dfd01 100644 --- a/src/ci/docker/dist-x86_64-musl/Dockerfile +++ b/src/ci/docker/dist-x86_64-musl/Dockerfile @@ -26,7 +26,7 @@ RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV RUST_CONFIGURE_ARGS \ diff --git a/src/ci/docker/dist-x86_64-netbsd/Dockerfile b/src/ci/docker/dist-x86_64-netbsd/Dockerfile index a1dd9a3724a88..cf08e891fcd9c 100644 --- a/src/ci/docker/dist-x86_64-netbsd/Dockerfile +++ b/src/ci/docker/dist-x86_64-netbsd/Dockerfile @@ -62,7 +62,7 @@ RUN ./build-netbsd-toolchain.sh USER root RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache ENV PATH=$PATH:/x-tools/x86_64-unknown-netbsd/bin diff --git a/src/ci/docker/emscripten/Dockerfile b/src/ci/docker/emscripten/Dockerfile index cbbca23f6e3db..13aac10ed1553 100644 --- a/src/ci/docker/emscripten/Dockerfile +++ b/src/ci/docker/emscripten/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ lib32stdc++6 RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/i686-gnu-nopt/Dockerfile b/src/ci/docker/i686-gnu-nopt/Dockerfile index 34d0567a440f9..707ea2478286d 100644 --- a/src/ci/docker/i686-gnu-nopt/Dockerfile +++ b/src/ci/docker/i686-gnu-nopt/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/i686-gnu/Dockerfile b/src/ci/docker/i686-gnu/Dockerfile index 960a0fa7a385f..6adb87f51aab1 100644 --- a/src/ci/docker/i686-gnu/Dockerfile +++ b/src/ci/docker/i686-gnu/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-aux/Dockerfile b/src/ci/docker/x86_64-gnu-aux/Dockerfile index 9871df90e00d5..3a22a6f8b493c 100644 --- a/src/ci/docker/x86_64-gnu-aux/Dockerfile +++ b/src/ci/docker/x86_64-gnu-aux/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-debug/Dockerfile b/src/ci/docker/x86_64-gnu-debug/Dockerfile index 197b0ec9b9bb6..4ec3f896af76b 100644 --- a/src/ci/docker/x86_64-gnu-debug/Dockerfile +++ b/src/ci/docker/x86_64-gnu-debug/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile index 60af302791a74..6d90270023ece 100644 --- a/src/ci/docker/x86_64-gnu-distcheck/Dockerfile +++ b/src/ci/docker/x86_64-gnu-distcheck/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-full-bootstrap/Dockerfile b/src/ci/docker/x86_64-gnu-full-bootstrap/Dockerfile index 4ec0b5c152575..cd0c0272c1ff3 100644 --- a/src/ci/docker/x86_64-gnu-full-bootstrap/Dockerfile +++ b/src/ci/docker/x86_64-gnu-full-bootstrap/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-incremental/Dockerfile b/src/ci/docker/x86_64-gnu-incremental/Dockerfile index 6448f88950f0d..dcb5dc5d9083d 100644 --- a/src/ci/docker/x86_64-gnu-incremental/Dockerfile +++ b/src/ci/docker/x86_64-gnu-incremental/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile b/src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile index c00667fe1dd00..9f98dea61c986 100644 --- a/src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile +++ b/src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu-nopt/Dockerfile b/src/ci/docker/x86_64-gnu-nopt/Dockerfile index 7284d231b844b..4dbb05a3133e4 100644 --- a/src/ci/docker/x86_64-gnu-nopt/Dockerfile +++ b/src/ci/docker/x86_64-gnu-nopt/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/ci/docker/x86_64-gnu/Dockerfile b/src/ci/docker/x86_64-gnu/Dockerfile index 1dce84bc5fd73..770a4c8c30200 100644 --- a/src/ci/docker/x86_64-gnu/Dockerfile +++ b/src/ci/docker/x86_64-gnu/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils RUN curl -o /usr/local/bin/sccache \ - https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-19-sccache-x86_64-unknown-linux-musl && \ chmod +x /usr/local/bin/sccache RUN curl -OL /~https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ diff --git a/src/etc/make-win-dist.py b/src/etc/make-win-dist.py index 394ff97d84533..4699fefbb20e3 100644 --- a/src/etc/make-win-dist.py +++ b/src/etc/make-win-dist.py @@ -49,7 +49,8 @@ def make_win_dist(rust_root, plat_root, target_triple): elif key == "libraries": lib_path.extend(val.lstrip(' =').split(';')) - target_tools = ["gcc.exe", "ld.exe", "ar.exe", "dlltool.exe"] + target_tools = ["gcc.exe", "ld.exe", "ar.exe", "dlltool.exe", + "libwinpthread-1.dll"] rustc_dlls = ["libstdc++-6.dll", "libwinpthread-1.dll"] if target_triple.startswith("i686-"): diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index fee0e1eb26083..418a084da6787 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -87,7 +87,6 @@ #![feature(needs_allocator)] #![feature(optin_builtin_traits)] #![feature(placement_in_syntax)] -#![cfg_attr(stage0, feature(pub_restricted))] #![feature(shared)] #![feature(staged_api)] #![feature(unboxed_closures)] diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index b028763158512..9f1870e56d38a 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -46,7 +46,6 @@ issue = "0")] #![allow(missing_docs)] -#[cfg(not(stage0))] #[stable(feature = "drop_in_place", since = "1.8.0")] #[rustc_deprecated(reason = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.18.0")] @@ -645,27 +644,6 @@ extern "rust-intrinsic" { pub fn size_of_val(_: &T) -> usize; pub fn min_align_of_val(_: &T) -> usize; - #[cfg(stage0)] - /// Executes the destructor (if any) of the pointed-to value. - /// - /// This has two use cases: - /// - /// * It is *required* to use `drop_in_place` to drop unsized types like - /// trait objects, because they can't be read out onto the stack and - /// dropped normally. - /// - /// * It is friendlier to the optimizer to do this over `ptr::read` when - /// dropping manually allocated memory (e.g. when writing Box/Rc/Vec), - /// as the compiler doesn't need to prove that it's sound to elide the - /// copy. - /// - /// # Undefined Behavior - /// - /// This has all the same safety problems as `ptr::read` with respect to - /// invalid pointers, types, and double drops. - #[stable(feature = "drop_in_place", since = "1.8.0")] - pub fn drop_in_place(to_drop: *mut T); - /// Gets a static string slice containing the name of a type. pub fn type_name() -> &'static str; @@ -1261,11 +1239,9 @@ extern "rust-intrinsic" { /// Performs an unchecked left shift, resulting in undefined behavior when /// y < 0 or y >= N, where N is the width of T in bits. - #[cfg(not(stage0))] pub fn unchecked_shl(x: T, y: T) -> T; /// Performs an unchecked right shift, resulting in undefined behavior when /// y < 0 or y >= N, where N is the width of T in bits. - #[cfg(not(stage0))] pub fn unchecked_shr(x: T, y: T) -> T; /// Returns (a + b) mod 2N, where N is the width of T in bits. diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index c0aa650a1e854..3f32db122351c 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -559,7 +559,7 @@ mod impls { /// any `UnsafeCell` internally, but not through an indirection. /// This affects, for example, whether a `static` of that type is /// placed in read-only static memory or writable static memory. -#[cfg_attr(not(stage0), lang = "freeze")] +#[lang = "freeze"] unsafe trait Freeze {} unsafe impl Freeze for .. {} diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 5c4a43fbd110a..18e2c1d5c73fd 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -778,21 +778,12 @@ macro_rules! int_impl { /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] #[inline(always)] - #[cfg(not(stage0))] pub fn wrapping_shl(self, rhs: u32) -> Self { unsafe { intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT) } } - /// Stage 0 - #[stable(feature = "num_wrapping", since = "1.2.0")] - #[inline(always)] - #[cfg(stage0)] - pub fn wrapping_shl(self, rhs: u32) -> Self { - self.overflowing_shl(rhs).0 - } - /// Panic-free bitwise shift-right; yields `self >> mask(rhs)`, /// where `mask` removes any high-order bits of `rhs` that /// would cause the shift to exceed the bitwidth of the type. @@ -814,21 +805,12 @@ macro_rules! int_impl { /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] #[inline(always)] - #[cfg(not(stage0))] pub fn wrapping_shr(self, rhs: u32) -> Self { unsafe { intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT) } } - /// Stage 0 - #[stable(feature = "num_wrapping", since = "1.2.0")] - #[inline(always)] - #[cfg(stage0)] - pub fn wrapping_shr(self, rhs: u32) -> Self { - self.overflowing_shr(rhs).0 - } - /// Wrapping (modular) absolute value. Computes `self.abs()`, /// wrapping around at the boundary of the type. /// @@ -1039,19 +1021,10 @@ macro_rules! int_impl { /// ``` #[inline] #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(not(stage0))] pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) { (self.wrapping_shl(rhs), (rhs > ($BITS - 1))) } - /// Stage 0 - #[inline] - #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(stage0)] - pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) { - (self << (rhs & ($BITS - 1)), (rhs > ($BITS - 1))) - } - /// Shifts self right by `rhs` bits. /// /// Returns a tuple of the shifted version of self along with a boolean @@ -1070,19 +1043,10 @@ macro_rules! int_impl { /// ``` #[inline] #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(not(stage0))] pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) { (self.wrapping_shr(rhs), (rhs > ($BITS - 1))) } - /// Stage 0 - #[inline] - #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(stage0)] - pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) { - (self >> (rhs & ($BITS - 1)), (rhs > ($BITS - 1))) - } - /// Computes the absolute value of `self`. /// /// Returns a tuple of the absolute version of self along with a @@ -1946,21 +1910,12 @@ macro_rules! uint_impl { /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] #[inline(always)] - #[cfg(not(stage0))] pub fn wrapping_shl(self, rhs: u32) -> Self { unsafe { intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT) } } - /// Stage 0 - #[stable(feature = "num_wrapping", since = "1.2.0")] - #[inline(always)] - #[cfg(stage0)] - pub fn wrapping_shl(self, rhs: u32) -> Self { - self.overflowing_shl(rhs).0 - } - /// Panic-free bitwise shift-right; yields `self >> mask(rhs)`, /// where `mask` removes any high-order bits of `rhs` that /// would cause the shift to exceed the bitwidth of the type. @@ -1982,21 +1937,12 @@ macro_rules! uint_impl { /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] #[inline(always)] - #[cfg(not(stage0))] pub fn wrapping_shr(self, rhs: u32) -> Self { unsafe { intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT) } } - /// Stage 0 - #[stable(feature = "num_wrapping", since = "1.2.0")] - #[inline(always)] - #[cfg(stage0)] - pub fn wrapping_shr(self, rhs: u32) -> Self { - self.overflowing_shr(rhs).0 - } - /// Calculates `self` + `rhs` /// /// Returns a tuple of the addition along with a boolean indicating @@ -2160,19 +2106,10 @@ macro_rules! uint_impl { /// ``` #[inline] #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(not(stage0))] pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) { (self.wrapping_shl(rhs), (rhs > ($BITS - 1))) } - /// Stage 0 - #[inline] - #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(stage0)] - pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) { - (self << (rhs & ($BITS - 1)), (rhs > ($BITS - 1))) - } - /// Shifts self right by `rhs` bits. /// /// Returns a tuple of the shifted version of self along with a boolean @@ -2191,20 +2128,11 @@ macro_rules! uint_impl { /// ``` #[inline] #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(not(stage0))] pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) { (self.wrapping_shr(rhs), (rhs > ($BITS - 1))) } - /// Stage 0 - #[inline] - #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg(stage0)] - pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) { - (self >> (rhs & ($BITS - 1)), (rhs > ($BITS - 1))) - } - /// Raises self to the power of `exp`, using exponentiation by squaring. /// /// # Examples diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 04480fc5d31da..115326bb9169a 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -37,11 +37,6 @@ pub use intrinsics::copy; #[stable(feature = "rust1", since = "1.0.0")] pub use intrinsics::write_bytes; -#[cfg(stage0)] -#[stable(feature = "drop_in_place", since = "1.8.0")] -pub use intrinsics::drop_in_place; - -#[cfg(not(stage0))] /// Executes the destructor (if any) of the pointed-to value. /// /// This has two use cases: diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index e5a6930fefd22..a3e5a14dbac7f 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -34,7 +34,6 @@ #![feature(loop_break_value)] #![feature(never_type)] #![feature(nonzero)] -#![cfg_attr(stage0, feature(pub_restricted))] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs index 60171f1a4289a..0358319256760 100644 --- a/src/librustc/middle/cstore.rs +++ b/src/librustc/middle/cstore.rs @@ -22,7 +22,7 @@ // are *mostly* used as a part of that interface, but these should // probably get a better home if someone can find one. -use hir::def::{self, Def}; +use hir::def; use hir::def_id::{CrateNum, DefId, DefIndex}; use hir::map as hir_map; use hir::map::definitions::{Definitions, DefKey, DisambiguatedDefPathData}; @@ -181,7 +181,6 @@ pub trait CrateStore { fn crate_data_as_rc_any(&self, krate: CrateNum) -> Rc; // item info - fn describe_def(&self, def: DefId) -> Option; fn def_span(&self, sess: &Session, def: DefId) -> Span; fn stability(&self, def: DefId) -> Option; fn deprecation(&self, def: DefId) -> Option; @@ -313,7 +312,6 @@ impl CrateStore for DummyCrateStore { fn crate_data_as_rc_any(&self, krate: CrateNum) -> Rc { bug!("crate_data_as_rc_any") } // item info - fn describe_def(&self, def: DefId) -> Option { bug!("describe_def") } fn def_span(&self, sess: &Session, def: DefId) -> Span { bug!("def_span") } fn stability(&self, def: DefId) -> Option { bug!("stability") } fn deprecation(&self, def: DefId) -> Option { bug!("deprecation") } diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 677eca10d7bae..9db6dffb0e8cc 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -451,7 +451,10 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> { // So peel off one-level, turning the &T into T. match base_ty.builtin_deref(false, ty::NoPreference) { Some(t) => t.ty, - None => { return Err(()); } + None => { + debug!("By-ref binding of non-derefable type {:?}", base_ty); + return Err(()); + } } } _ => base_ty, @@ -1039,6 +1042,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> { match base_cmt.ty.builtin_index() { Some(ty) => (ty, ElementKind::VecElement), None => { + debug!("Explicit index of non-indexable type {:?}", base_cmt); return Err(()); } } @@ -1154,7 +1158,10 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> { PatKind::TupleStruct(hir::QPath::Resolved(_, ref path), ..) | PatKind::Struct(hir::QPath::Resolved(_, ref path), ..) => { match path.def { - Def::Err => return Err(()), + Def::Err => { + debug!("access to unresolvable pattern {:?}", pat); + return Err(()) + } Def::Variant(variant_did) | Def::VariantCtor(variant_did, ..) => { // univariant enums do not need downcasts diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 7431eb3fe96ef..1ac7f4fcc95c2 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -432,7 +432,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { // (See issue #38412) fn skip_stability_check_due_to_privacy(self, mut def_id: DefId) -> bool { // Check if `def_id` is a trait method. - match self.sess.cstore.describe_def(def_id) { + match self.describe_def(def_id) { Some(Def::Method(_)) | Some(Def::AssociatedTy(_)) | Some(Def::AssociatedConst(_)) => { diff --git a/src/librustc/ty/maps.rs b/src/librustc/ty/maps.rs index 1407e57dc2a6a..fa91facd95e00 100644 --- a/src/librustc/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -10,6 +10,7 @@ use dep_graph::{DepGraph, DepNode, DepTrackingMap, DepTrackingMapConfig}; use hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; +use hir::def::Def; use hir; use middle::const_val; use middle::privacy::AccessLevels; @@ -242,6 +243,12 @@ impl<'tcx> QueryDescription for queries::const_eval<'tcx> { } } +impl<'tcx> QueryDescription for queries::describe_def<'tcx> { + fn describe(_: TyCtxt, _: DefId) -> String { + bug!("describe_def") + } +} + macro_rules! define_maps { (<$tcx:tt> $($(#[$attr:meta])* @@ -513,7 +520,9 @@ define_maps! { <'tcx> pub reachable_set: reachability_dep_node(CrateNum) -> Rc, - pub mir_shims: mir_shim_dep_node(ty::InstanceDef<'tcx>) -> &'tcx RefCell> + pub mir_shims: mir_shim_dep_node(ty::InstanceDef<'tcx>) -> &'tcx RefCell>, + + pub describe_def: meta_data_node(DefId) -> Option } fn coherent_trait_dep_node((_, def_id): (CrateNum, DefId)) -> DepNode { @@ -539,3 +548,7 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode { fn const_eval_dep_node((def_id, _): (DefId, &Substs)) -> DepNode { DepNode::ConstEval(def_id) } + +fn meta_data_node(def_id: DefId) -> DepNode { + DepNode::MetaData(def_id) +} diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 9a8c91f5820dc..7d73ba456f8a2 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2384,7 +2384,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// ID of the impl that the method belongs to. Otherwise, return `None`. pub fn impl_of_method(self, def_id: DefId) -> Option { let item = if def_id.krate != LOCAL_CRATE { - if let Some(Def::Method(_)) = self.sess.cstore.describe_def(def_id) { + if let Some(Def::Method(_)) = self.describe_def(def_id) { Some(self.associated_item(def_id)) } else { None diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs index 3678c2e55c1fd..ebe2de5840954 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs @@ -11,6 +11,7 @@ use borrowck::BorrowckCtxt; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; +use rustc::middle::mem_categorization::NoteClosureEnv; use rustc::middle::mem_categorization::InteriorOffsetKind as Kind; use rustc::ty; use syntax::ast; @@ -71,10 +72,12 @@ fn report_move_errors<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, let mut err = report_cannot_move_out_of(bccx, error.move_from.clone()); let mut is_first_note = true; for move_to in &error.move_to_places { - err = note_move_destination(err, move_to.span, - move_to.name, is_first_note); + err = note_move_destination(err, move_to.span, move_to.name, is_first_note); is_first_note = false; } + if let NoteClosureEnv(upvar_id) = error.move_from.note { + err.span_label(bccx.tcx.hir.span(upvar_id.var_id), &"captured outer variable"); + } err.emit(); } } diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs index 9470316c7e7e0..8b1aa0708807b 100644 --- a/src/librustc_const_eval/eval.rs +++ b/src/librustc_const_eval/eval.rs @@ -68,7 +68,7 @@ pub fn lookup_const_by_id<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, _ => Some((def_id, substs)) } } else { - match tcx.sess.cstore.describe_def(def_id) { + match tcx.describe_def(def_id) { Some(Def::AssociatedConst(_)) => { // As mentioned in the comments above for in-crate // constants, we only try to find the expression for a diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index da29e354a7014..cc8012d965a76 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -375,6 +375,9 @@ impl Handler { panic!(ExplicitBug); } pub fn delay_span_bug>(&self, sp: S, msg: &str) { + if self.treat_err_as_bug { + self.span_bug(sp, msg); + } let mut delayed = self.delayed_span_bug.borrow_mut(); *delayed = Some((sp.into(), msg.to_string())); } diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index aa7eb36581f3e..95f0a96fdf965 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -24,7 +24,6 @@ #![feature(rand)] #![feature(conservative_impl_trait)] #![feature(sort_unstable)] -#![cfg_attr(stage0, feature(pub_restricted))] extern crate graphviz; #[macro_use] extern crate rustc; diff --git a/src/librustc_metadata/cstore_impl.rs b/src/librustc_metadata/cstore_impl.rs index ddb3332be3731..839caca2ee914 100644 --- a/src/librustc_metadata/cstore_impl.rs +++ b/src/librustc_metadata/cstore_impl.rs @@ -17,7 +17,7 @@ use rustc::dep_graph::DepTrackingMapConfig; use rustc::middle::cstore::{CrateStore, CrateSource, LibSource, DepKind, ExternCrate, NativeLibrary, LinkMeta, LinkagePreference, LoadedMacro, EncodedMetadata}; -use rustc::hir::def::{self, Def}; +use rustc::hir::def; use rustc::middle::lang_items; use rustc::session::Session; use rustc::ty::{self, TyCtxt}; @@ -113,6 +113,7 @@ provide! { <'tcx> tcx, def_id, cdata closure_type => { cdata.closure_ty(def_id.index, tcx) } inherent_impls => { Rc::new(cdata.get_inherent_implementations_for_type(def_id.index)) } is_foreign_item => { cdata.is_foreign_item(def_id.index) } + describe_def => { cdata.get_def(def_id.index) } } impl CrateStore for cstore::CStore { @@ -120,11 +121,6 @@ impl CrateStore for cstore::CStore { self.get_crate_data(krate) } - fn describe_def(&self, def: DefId) -> Option { - self.dep_graph.read(DepNode::MetaData(def)); - self.get_crate_data(def.krate).get_def(def.index) - } - fn def_span(&self, sess: &Session, def: DefId) -> Span { self.dep_graph.read(DepNode::MetaData(def)); self.get_crate_data(def.krate).get_span(def.index, sess) diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index f0a74ea4be92c..e81805b96609b 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -516,6 +516,8 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { }; let index_expr_ty = self.node_ty(index_expr.id); + let adjusted_base_ty = self.resolve_type_vars_if_possible(&adjusted_base_ty); + let index_expr_ty = self.resolve_type_vars_if_possible(&index_expr_ty); let result = self.try_index_step(ty::MethodCall::expr(expr.id), expr, @@ -531,6 +533,15 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { let expr_ty = self.node_ty(expr.id); self.demand_suptype(expr.span, expr_ty, return_ty); + } else { + // We could not perform a mutable index. Re-apply the + // immutable index adjustments - borrowck will detect + // this as an error. + if let Some(adjustment) = adjustment { + self.apply_adjustment(expr.id, adjustment); + } + self.tcx.sess.delay_span_bug( + expr.span, "convert_lvalue_derefs_to_mutable failed"); } } hir::ExprUnary(hir::UnDeref, ref base_expr) => { diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 70225da5f3355..a4c3b276efdd2 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -318,7 +318,6 @@ #![feature(unwind_attributes)] #![feature(vec_push_all)] #![cfg_attr(test, feature(update_panic_count))] -#![cfg_attr(stage0, feature(pub_restricted))] #![cfg_attr(test, feature(float_bits_conv))] // Explicitly import the prelude. The compiler uses this same unstable attribute diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index 8def11295fda8..34229f80769ab 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -72,24 +72,23 @@ pub struct TcpStream(net_imp::TcpStream); /// /// # Examples /// -/// ```no_run +/// ``` +/// # use std::io; /// use std::net::{TcpListener, TcpStream}; /// -/// let listener = TcpListener::bind("127.0.0.1:80").unwrap(); -/// /// fn handle_client(stream: TcpStream) { /// // ... /// } /// +/// # fn process() -> io::Result<()> { +/// let listener = TcpListener::bind("127.0.0.1:80").unwrap(); +/// /// // accept connections and process them serially /// for stream in listener.incoming() { -/// match stream { -/// Ok(stream) => { -/// handle_client(stream); -/// } -/// Err(e) => { /* connection failed */ } -/// } +/// handle_client(stream?); /// } +/// # Ok(()) +/// # } /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub struct TcpListener(net_imp::TcpListener); diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 6c8839224f77d..2cb649ce67b9c 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -297,12 +297,14 @@ mod sync; mod mpsc_queue; mod spsc_queue; -/// The receiving-half of Rust's channel type. This half can only be owned by -/// one thread. +/// The receiving half of Rust's [`channel`][] (or [`sync_channel`]) type. +/// This half can only be owned by one thread. /// /// Messages sent to the channel can be retrieved using [`recv`]. /// -/// [`recv`]: ../../../std/sync/mpsc/struct.Receiver.html#method.recv +/// [`channel`]: fn.channel.html +/// [`sync_channel`]: fn.sync_channel.html +/// [`recv`]: struct.Receiver.html#method.recv /// /// # Examples /// @@ -336,51 +338,128 @@ unsafe impl Send for Receiver { } #[stable(feature = "rust1", since = "1.0.0")] impl !Sync for Receiver { } -/// An iterator over messages on a receiver, this iterator will block whenever -/// [`next`] is called, waiting for a new message, and [`None`] will be returned +/// An iterator over messages on a [`Receiver`], created by [`iter`]. +/// +/// This iterator will block whenever [`next`] is called, +/// waiting for a new message, and [`None`] will be returned /// when the corresponding channel has hung up. /// +/// [`iter`]: struct.Receiver.html#method.iter +/// [`Receiver`]: struct.Receiver.html /// [`next`]: ../../../std/iter/trait.Iterator.html#tymethod.next /// [`None`]: ../../../std/option/enum.Option.html#variant.None +/// +/// # Examples +/// +/// ```rust +/// use std::sync::mpsc::channel; +/// use std::thread; +/// +/// let (send, recv) = channel(); +/// +/// thread::spawn(move || { +/// send.send(1u8).unwrap(); +/// send.send(2u8).unwrap(); +/// send.send(3u8).unwrap(); +/// }); +/// +/// for x in recv.iter() { +/// println!("Got: {}", x); +/// } +/// ``` #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Iter<'a, T: 'a> { rx: &'a Receiver } -/// An iterator that attempts to yield all pending values for a receiver. -/// [`None`] will be returned when there are no pending values remaining or if -/// the corresponding channel has hung up. +/// An iterator that attempts to yield all pending values for a [`Receiver`], +/// created by [`try_iter`]. +/// +/// [`None`] will be returned when there are no pending values remaining or +/// if the corresponding channel has hung up. /// -/// This Iterator will never block the caller in order to wait for data to +/// This iterator will never block the caller in order to wait for data to /// become available. Instead, it will return [`None`]. /// +/// [`Receiver`]: struct.Receiver.html +/// [`try_iter`]: struct.Receiver.html#method.try_iter /// [`None`]: ../../../std/option/enum.Option.html#variant.None +/// +/// # Examples +/// +/// ```rust +/// use std::sync::mpsc::channel; +/// use std::thread; +/// use std::time::Duration; +/// +/// let (sender, receiver) = channel(); +/// +/// // Nothing is in the buffer yet +/// assert!(receiver.try_iter().next().is_none()); +/// println!("Nothing in the buffer..."); +/// +/// thread::spawn(move || { +/// sender.send(1).unwrap(); +/// sender.send(2).unwrap(); +/// sender.send(3).unwrap(); +/// }); +/// +/// println!("Going to sleep..."); +/// thread::sleep(Duration::from_secs(2)); // block for two seconds +/// +/// for x in receiver.try_iter() { +/// println!("Got: {}", x); +/// } +/// ``` #[stable(feature = "receiver_try_iter", since = "1.15.0")] #[derive(Debug)] pub struct TryIter<'a, T: 'a> { rx: &'a Receiver } -/// An owning iterator over messages on a receiver, this iterator will block -/// whenever [`next`] is called, waiting for a new message, and [`None`] will be -/// returned when the corresponding channel has hung up. +/// An owning iterator over messages on a [`Receiver`], +/// created by **Receiver::into_iter**. +/// +/// This iterator will block whenever [`next`] +/// is called, waiting for a new message, and [`None`] will be +/// returned if the corresponding channel has hung up. /// +/// [`Receiver`]: struct.Receiver.html /// [`next`]: ../../../std/iter/trait.Iterator.html#tymethod.next /// [`None`]: ../../../std/option/enum.Option.html#variant.None /// +/// # Examples +/// +/// ```rust +/// use std::sync::mpsc::channel; +/// use std::thread; +/// +/// let (send, recv) = channel(); +/// +/// thread::spawn(move || { +/// send.send(1u8).unwrap(); +/// send.send(2u8).unwrap(); +/// send.send(3u8).unwrap(); +/// }); +/// +/// for x in recv.into_iter() { +/// println!("Got: {}", x); +/// } +/// ``` #[stable(feature = "receiver_into_iter", since = "1.1.0")] #[derive(Debug)] pub struct IntoIter { rx: Receiver } -/// The sending-half of Rust's asynchronous channel type. This half can only be +/// The sending-half of Rust's asynchronous [`channel`] type. This half can only be /// owned by one thread, but it can be cloned to send to other threads. /// /// Messages can be sent through this channel with [`send`]. /// -/// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send +/// [`channel`]: fn.channel.html +/// [`send`]: struct.Sender.html#method.send /// /// # Examples /// @@ -419,12 +498,55 @@ unsafe impl Send for Sender { } #[stable(feature = "rust1", since = "1.0.0")] impl !Sync for Sender { } -/// The sending-half of Rust's synchronous channel type. This half can only be -/// owned by one thread, but it can be cloned to send to other threads. +/// The sending-half of Rust's synchronous [`sync_channel`] type. +/// This half can only be owned by one thread, but it can be cloned +/// to send to other threads. +/// +/// Messages can be sent through this channel with [`send`] or [`try_send`]. +/// +/// [`send`] will block if there is no space in the internal buffer. +/// +/// [`sync_channel`]: fn.sync_channel.html +/// [`send`]: struct.SyncSender.html#method.send +/// [`try_send`]: struct.SyncSender.html#method.try_send +/// +/// # Examples +/// +/// ```rust +/// use std::sync::mpsc::sync_channel; +/// use std::thread; /// -/// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send -/// [`SyncSender::send`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.send +/// // Create a sync_channel with buffer size 2 +/// let (sync_sender, receiver) = sync_channel(2); +/// let sync_sender2 = sync_sender.clone(); /// +/// // First thread owns sync_sender +/// thread::spawn(move || { +/// sync_sender.send(1).unwrap(); +/// sync_sender.send(2).unwrap(); +/// }); +/// +/// // Second thread owns sync_sender2 +/// thread::spawn(move || { +/// sync_sender2.send(3).unwrap(); +/// // thread will now block since the buffer is full +/// println!("Thread unblocked!"); +/// }); +/// +/// let mut msg; +/// +/// msg = receiver.recv().unwrap(); +/// println!("message {} received", msg); +/// +/// // "Thread unblocked!" will be printed now +/// +/// msg = receiver.recv().unwrap(); +/// println!("message {} received", msg); +/// +/// msg = receiver.recv().unwrap(); +/// +/// println!("message {} received", msg); +/// ``` #[stable(feature = "rust1", since = "1.0.0")] pub struct SyncSender { inner: Arc>, @@ -823,8 +945,9 @@ impl SyncSender { /// Note that a successful send does *not* guarantee that the receiver will /// ever see the data if there is a buffer on this channel. Items may be /// enqueued in the internal buffer for the receiver to receive at a later - /// time. If the buffer size is 0, however, it can be guaranteed that the - /// receiver has indeed received the data if this function returns success. + /// time. If the buffer size is 0, however, the channel becomes a rendezvous + /// channel and it guarantees that the receiver has indeed received + /// the data if this function returns success. /// /// This function will never panic, but it may return [`Err`] if the /// [`Receiver`] has disconnected and is no longer able to receive @@ -832,6 +955,27 @@ impl SyncSender { /// /// [`Err`]: ../../../std/result/enum.Result.html#variant.Err /// [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html + /// + /// # Examples + /// + /// ```rust + /// use std::sync::mpsc::sync_channel; + /// use std::thread; + /// + /// // Create a rendezvous sync_channel with buffer size 0 + /// let (sync_sender, receiver) = sync_channel(0); + /// + /// thread::spawn(move || { + /// println!("sending message..."); + /// sync_sender.send(1).unwrap(); + /// // Thread is now blocked until the message is received + /// + /// println!("...message received!"); + /// }); + /// + /// let msg = receiver.recv().unwrap(); + /// assert_eq!(1, msg); + /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn send(&self, t: T) -> Result<(), SendError> { self.inner.send(t).map_err(SendError) @@ -844,11 +988,48 @@ impl SyncSender { /// data. Compared with [`send`], this function has two failure cases /// instead of one (one for disconnection, one for a full buffer). /// - /// See [`SyncSender::send`] for notes about guarantees of whether the + /// See [`send`] for notes about guarantees of whether the /// receiver has received the data or not if this function is successful. /// - /// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send - /// [`SyncSender::send`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.send + /// [`send`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.send + /// + /// # Examples + /// + /// ```rust + /// use std::sync::mpsc::sync_channel; + /// use std::thread; + /// + /// // Create a sync_channel with buffer size 1 + /// let (sync_sender, receiver) = sync_channel(1); + /// let sync_sender2 = sync_sender.clone(); + /// + /// // First thread owns sync_sender + /// thread::spawn(move || { + /// sync_sender.send(1).unwrap(); + /// sync_sender.send(2).unwrap(); + /// // Thread blocked + /// }); + /// + /// // Second thread owns sync_sender2 + /// thread::spawn(move || { + /// // This will return an error and send + /// // no message if the buffer is full + /// sync_sender2.try_send(3).is_err(); + /// }); + /// + /// let mut msg; + /// msg = receiver.recv().unwrap(); + /// println!("message {} received", msg); + /// + /// msg = receiver.recv().unwrap(); + /// println!("message {} received", msg); + /// + /// // Third message may have never been sent + /// match receiver.try_recv() { + /// Ok(msg) => println!("message {} received", msg), + /// Err(_) => println!("the third message was never sent"), + /// } + /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn try_send(&self, t: T) -> Result<(), TrySendError> { self.inner.try_send(t) @@ -894,6 +1075,21 @@ impl Receiver { /// /// This is useful for a flavor of "optimistic check" before deciding to /// block on a receiver. + /// + /// Compared with [`recv`], this function has two failure cases instead of one + /// (one for disconnection, one for an empty buffer). + /// + /// [`recv`]: struct.Receiver.html#method.recv + /// + /// # Examples + /// + /// ```rust + /// use std::sync::mpsc::{Receiver, channel}; + /// + /// let (_, receiver): (_, Receiver) = channel(); + /// + /// assert!(receiver.try_recv().is_err()); + /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn try_recv(&self) -> Result { loop { @@ -949,8 +1145,8 @@ impl Receiver { /// /// This function will always block the current thread if there is no data /// available and it's possible for more data to be sent. Once a message is - /// sent to the corresponding [`Sender`], then this receiver will wake up and - /// return that message. + /// sent to the corresponding [`Sender`][] (or [`SyncSender`]), then this + /// receiver will wake up and return that message. /// /// If the corresponding [`Sender`] has disconnected, or it disconnects while /// this call is blocking, this call will wake up and return [`Err`] to @@ -958,7 +1154,8 @@ impl Receiver { /// However, since channels are buffered, messages sent before the disconnect /// will still be properly received. /// - /// [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html + /// [`Sender`]: struct.Sender.html + /// [`SyncSender`]: struct.SyncSender.html /// [`Err`]: ../../../std/result/enum.Result.html#variant.Err /// /// # Examples @@ -1040,8 +1237,8 @@ impl Receiver { /// /// This function will always block the current thread if there is no data /// available and it's possible for more data to be sent. Once a message is - /// sent to the corresponding [`Sender`], then this receiver will wake up and - /// return that message. + /// sent to the corresponding [`Sender`][] (or [`SyncSender`]), then this + /// receiver will wake up and return that message. /// /// If the corresponding [`Sender`] has disconnected, or it disconnects while /// this call is blocking, this call will wake up and return [`Err`] to @@ -1049,7 +1246,8 @@ impl Receiver { /// However, since channels are buffered, messages sent before the disconnect /// will still be properly received. /// - /// [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html + /// [`Sender`]: struct.Sender.html + /// [`SyncSender`]: struct.SyncSender.html /// [`Err`]: ../../../std/result/enum.Result.html#variant.Err /// /// # Examples @@ -1163,6 +1361,33 @@ impl Receiver { /// user by waiting for values. /// /// [`panic!`]: ../../../std/macro.panic.html + /// + /// # Examples + /// + /// ```rust + /// use std::sync::mpsc::channel; + /// use std::thread; + /// use std::time::Duration; + /// + /// let (sender, receiver) = channel(); + /// + /// // Nothing is in the buffer yet + /// assert!(receiver.try_iter().next().is_none()); + /// println!("Nothing in the buffer..."); + /// + /// thread::spawn(move || { + /// sender.send(1).unwrap(); + /// sender.send(2).unwrap(); + /// sender.send(3).unwrap(); + /// }); + /// + /// println!("Going to sleep..."); + /// thread::sleep(Duration::from_secs(2)); // block for two seconds + /// + /// for x in receiver.try_iter() { + /// println!("Got: {}", x); + /// } + /// ``` #[stable(feature = "receiver_try_iter", since = "1.15.0")] pub fn try_iter(&self) -> TryIter { TryIter { rx: self } diff --git a/src/llvm b/src/llvm index 878af191434cd..15745af768384 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 878af191434cd716eeb13c2be7a2b1e21abf2749 +Subproject commit 15745af7683844e43bdec966072b8e7b44772450 diff --git a/src/rtstartup/rsbegin.rs b/src/rtstartup/rsbegin.rs index e8b92aab1da1e..d694905c0d430 100644 --- a/src/rtstartup/rsbegin.rs +++ b/src/rtstartup/rsbegin.rs @@ -34,7 +34,7 @@ trait Sync {} impl Sync for .. {} #[lang = "copy"] trait Copy {} -#[cfg_attr(not(stage0), lang = "freeze")] +#[lang = "freeze"] trait Freeze {} impl Freeze for .. {} diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index 52ebf449d6007..1006445ade6a1 100644 --- a/src/rustllvm/llvm-rebuild-trigger +++ b/src/rustllvm/llvm-rebuild-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2017-04-25 +2017-04-26 diff --git a/src/stage0.txt b/src/stage0.txt index dc6931c1d0bdd..974be12565118 100644 --- a/src/stage0.txt +++ b/src/stage0.txt @@ -8,8 +8,30 @@ # release. # # If you're looking at this file on the master branch, you'll likely see that -# rustc bootstraps from `beta-$date`, whereas if you're looking at a source -# tarball for a stable release you'll likely see `1.x.0-$date` where `1.x.0` was -# released on `$date` +# rustc and cargo are configured to `beta`, whereas if you're looking at a +# source tarball for a stable release you'll likely see `1.x.0` for rustc and +# `0.x.0` for Cargo where they were released on `date`. -rustc: beta-2017-04-05 +date: 2017-04-25 +rustc: beta +cargo: beta + +# When making a stable release the process currently looks like: +# +# 1. Produce stable build, upload it to dev-static +# 2. Produce a beta build from the previous stable build, upload to static +# 3. Produce a nightly build from previous beta, upload to static +# 4. Upload stable build to static, publish full release +# +# This means that there's a small window of time (a few days) where artifacts +# are downloaded from dev-static.rust-lang.org instead of static.rust-lang.org. +# In order to ease this transition we have an extra key is in this configuration +# file below. When uncommented this will instruct the bootstrap.py script to +# download from dev-static.rust-lang.org. +# +# This key is typically commented out at all times. If you're looking at a +# stable release tarball it should *definitely* be commented out. If you're +# looking at a beta source tarball and it's uncommented we'll shortly comment it +# out. + +#dev: 1 diff --git a/src/test/run-pass/issue-41498.rs b/src/test/run-pass/issue-41498.rs new file mode 100644 index 0000000000000..66fd30bdbbbe4 --- /dev/null +++ b/src/test/run-pass/issue-41498.rs @@ -0,0 +1,26 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// regression test for issue #41498. + +struct S; +impl S { + fn mutate(&mut self) {} +} + +fn call_and_ref T>(x: &mut Option, f: F) -> &mut T { + *x = Some(f()); + x.as_mut().unwrap() +} + +fn main() { + let mut n = None; + call_and_ref(&mut n, || [S])[0].mutate(); +} diff --git a/src/test/compile-fail/borrowck/borrowck-in-static.rs b/src/test/ui/borrowck/borrowck-in-static.rs similarity index 94% rename from src/test/compile-fail/borrowck/borrowck-in-static.rs rename to src/test/ui/borrowck/borrowck-in-static.rs index 16b0e8638de39..9244c12347d95 100644 --- a/src/test/compile-fail/borrowck/borrowck-in-static.rs +++ b/src/test/ui/borrowck/borrowck-in-static.rs @@ -11,7 +11,7 @@ // check that borrowck looks inside consts/statics static FN : &'static (Fn() -> (BoxBox>) + Sync) = &|| { - let x = Box::new(0); + let x = Box::new(0); //~ NOTE moved Box::new(|| x) //~ ERROR cannot move out of captured outer variable }; diff --git a/src/test/ui/borrowck/borrowck-in-static.stderr b/src/test/ui/borrowck/borrowck-in-static.stderr new file mode 100644 index 0000000000000..6083a82b1b6de --- /dev/null +++ b/src/test/ui/borrowck/borrowck-in-static.stderr @@ -0,0 +1,10 @@ +error[E0507]: cannot move out of captured outer variable in an `Fn` closure + --> $DIR/borrowck-in-static.rs:15:17 + | +14 | let x = Box::new(0); //~ NOTE moved + | - captured outer variable +15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable + | ^ cannot move out of captured outer variable in an `Fn` closure + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unboxed-closures-move-upvar-from-non-once-ref-closure.rs b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs similarity index 93% rename from src/test/compile-fail/unboxed-closures-move-upvar-from-non-once-ref-closure.rs rename to src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs index cd9f1636c3f4d..9c89c26de006a 100644 --- a/src/test/compile-fail/unboxed-closures-move-upvar-from-non-once-ref-closure.rs +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs @@ -16,7 +16,7 @@ fn call(f: F) where F : Fn() { } fn main() { - let y = vec![format!("World")]; + let y = vec![format!("World")]; //~ NOTE moved call(|| { y.into_iter(); //~^ ERROR cannot move out of captured outer variable in an `Fn` closure diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr new file mode 100644 index 0000000000000..dbfcb2e0c2f95 --- /dev/null +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr @@ -0,0 +1,11 @@ +error[E0507]: cannot move out of captured outer variable in an `Fn` closure + --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9 + | +19 | let y = vec![format!("World")]; //~ NOTE moved + | - captured outer variable +20 | call(|| { +21 | y.into_iter(); + | ^ cannot move out of captured outer variable in an `Fn` closure + +error: aborting due to previous error + diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs index 6264d11186452..29fea052b06c2 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs @@ -21,8 +21,11 @@ struct Test<'a> { fn call(mut f: F) where F: FnMut(Fn) { f(Box::new(|| { //~^ ERROR: cannot borrow `f` as mutable more than once + //~| NOTE first mutable borrow occurs here + //~| NOTE second mutable borrow occurs here f((Box::new(|| {}))) })); + //~^ NOTE first borrow ends here } fn test1() { @@ -32,7 +35,10 @@ fn test1() { } fn test2(f: &F) where F: FnMut() { - (*f)(); //~ ERROR: cannot borrow immutable borrowed content `*f` as mutable + //~^ NOTE use `&mut F` here to make mutable + (*f)(); + //~^ ERROR cannot borrow immutable borrowed content `*f` as mutable + //~| NOTE cannot borrow as mutable } fn test3(f: &mut F) where F: FnMut() { @@ -40,7 +46,10 @@ fn test3(f: &mut F) where F: FnMut() { } fn test4(f: &Test) { - f.f.call_mut(()) //~ ERROR: cannot borrow immutable `Box` content `*f.f` as mutable + //~^ NOTE use `&mut Test` here to make mutable + f.f.call_mut(()) + //~^ ERROR: cannot borrow immutable `Box` content `*f.f` as mutable + //~| NOTE cannot borrow as mutable } fn test5(f: &mut Test) { @@ -57,10 +66,14 @@ fn test6() { fn test7() { fn foo(_: F) where F: FnMut(Box, isize) {} let mut f = |g: Box, b: isize| {}; + //~^ NOTE moved f(Box::new(|a| { + //~^ NOTE borrow of `f` occurs here foo(f); //~^ ERROR cannot move `f` into closure because it is borrowed //~| ERROR cannot move out of captured outer variable in an `FnMut` closure + //~| NOTE move into closure occurs here + //~| NOTE cannot move out of captured outer variable in an `FnMut` closure }), 3); } diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr index 58b3f205fe352..4ece8bc6af10f 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr @@ -5,40 +5,46 @@ error[E0499]: cannot borrow `f` as mutable more than once at a time | - ^^ second mutable borrow occurs here | | | first mutable borrow occurs here -23 | //~^ ERROR: cannot borrow `f` as mutable more than once -24 | f((Box::new(|| {}))) +... +26 | f((Box::new(|| {}))) | - borrow occurs due to use of `f` in closure -25 | })); +27 | })); | - first borrow ends here error: cannot borrow immutable borrowed content `*f` as mutable - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:35:5 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:39:5 | -34 | fn test2(f: &F) where F: FnMut() { +37 | fn test2(f: &F) where F: FnMut() { | -- use `&mut F` here to make mutable -35 | (*f)(); //~ ERROR: cannot borrow immutable borrowed content `*f` as mutable +38 | //~^ NOTE use `&mut F` here to make mutable +39 | (*f)(); | ^^^^ cannot borrow as mutable error: cannot borrow immutable `Box` content `*f.f` as mutable - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:43:5 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:50:5 | -42 | fn test4(f: &Test) { +48 | fn test4(f: &Test) { | ----- use `&mut Test` here to make mutable -43 | f.f.call_mut(()) //~ ERROR: cannot borrow immutable `Box` content `*f.f` as mutable +49 | //~^ NOTE use `&mut Test` here to make mutable +50 | f.f.call_mut(()) | ^^^ cannot borrow as mutable error[E0504]: cannot move `f` into closure because it is borrowed - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:61:13 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:72:13 | -60 | f(Box::new(|a| { +70 | f(Box::new(|a| { | - borrow of `f` occurs here -61 | foo(f); +71 | //~^ NOTE borrow of `f` occurs here +72 | foo(f); | ^ move into closure occurs here error[E0507]: cannot move out of captured outer variable in an `FnMut` closure - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:61:13 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:72:13 | -61 | foo(f); +68 | let mut f = |g: Box, b: isize| {}; + | ----- captured outer variable +... +72 | foo(f); | ^ cannot move out of captured outer variable in an `FnMut` closure error: aborting due to 5 previous errors diff --git a/src/tools/cargo b/src/tools/cargo new file mode 160000 index 0000000000000..fa7584c1495c2 --- /dev/null +++ b/src/tools/cargo @@ -0,0 +1 @@ +Subproject commit fa7584c1495c2d9c04a6416f8e7b546abfa88a52 diff --git a/src/tools/rls b/src/tools/rls new file mode 160000 index 0000000000000..67babd2d63710 --- /dev/null +++ b/src/tools/rls @@ -0,0 +1 @@ +Subproject commit 67babd2d63710444a3071dfd9184648fd85a6a3d diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 3e7046d05f490..f14a6a03893b3 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -85,6 +85,8 @@ fn filter_dirs(path: &Path) -> bool { "src/liblibc", "src/vendor", "src/rt/hoedown", + "src/tools/cargo", + "src/tools/rls", ]; skip.iter().any(|p| path.ends_with(p)) }