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/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.lock b/src/Cargo.lock index f4c35719f3631..0a584ac6b01c4 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -78,7 +78,7 @@ dependencies = [ "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -299,7 +299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num_cpus" -version = "0.2.13" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1004,7 +1004,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mdbook 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "2598843aeda0c5bb2e8e4d714564f1c3fc40f7844157e34563bf96ae3866b56e" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99" -"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" +"checksum num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca313f1862c7ec3e0dfe8ace9fa91b1d9cb5c84ace3d00f5ec4216238e93c167" "checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" "checksum pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8" "checksum pulldown-cmark 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab1e588ef8efd702c7ed9d2bd774db5e6f4d878bb5a1a9f371828fbdff6973" 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 1eda1608c4709..ecfddec328cd1 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -27,7 +27,7 @@ test = false build_helper = { path = "../build_helper" } cmake = "0.1.17" filetime = "0.1" -num_cpus = "0.2" +num_cpus = "1.0" toml = "0.1" getopts = "0.2" rustc-serialize = "0.3" diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3233a73b007cc..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") @@ -367,6 +371,9 @@ def build_bootstrap(self): env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ (os.pathsep + env["DYLD_LIBRARY_PATH"]) \ if "DYLD_LIBRARY_PATH" in env else "" + env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ + (os.pathsep + env["LIBRARY_PATH"]) \ + if "LIBRARY_PATH" in env else "" env["PATH"] = os.path.join(self.bin_root(), "bin") + \ os.pathsep + env["PATH"] if not os.path.isfile(self.cargo()): @@ -407,7 +414,11 @@ def build_triple(self): # The goal here is to come up with the same triple as LLVM would, # at least for the subset of platforms we're willing to target. if ostype == 'Linux': - ostype = 'unknown-linux-gnu' + os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding) + if os == 'Android': + ostype = 'linux-android' + else: + ostype = 'unknown-linux-gnu' elif ostype == 'FreeBSD': ostype = 'unknown-freebsd' elif ostype == 'DragonFly': @@ -464,15 +475,21 @@ def build_triple(self): cputype = 'i686' elif cputype in {'xscale', 'arm'}: cputype = 'arm' + if ostype == 'linux-android': + ostype = 'linux-androideabi' elif cputype == 'armv6l': cputype = 'arm' - ostype += 'eabihf' + if ostype == 'linux-android': + ostype = 'linux-androideabi' + else: + ostype += 'eabihf' elif cputype in {'armv7l', 'armv8l'}: cputype = 'armv7' - ostype += 'eabihf' - elif cputype == 'aarch64': - cputype = 'aarch64' - elif cputype == 'arm64': + if ostype == 'linux-android': + ostype = 'linux-androideabi' + else: + ostype += 'eabihf' + elif cputype in {'aarch64', 'arm64'}: cputype = 'aarch64' elif cputype == 'mips': if sys.byteorder == 'big': @@ -572,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/config.toml.example b/src/bootstrap/config.toml.example index fad79022043e3..0309eca0e5dea 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -51,7 +51,7 @@ # support. You'll need to write a target specification at least, and most # likely, teach rustc about the C ABI of the target. Get in touch with the # Rust team and file an issue if you need assistance in porting! -#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX" +#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon" # Cap the number of parallel linker invocations when compiling LLVM. # This can be useful when building LLVM with debug info, which significantly diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index ada8d4df604e3..639ba5d5b0c48 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -374,13 +374,11 @@ pub fn rust_src(build: &Build) { println!("Dist src"); - let name = pkgname(build, "rust-src"); - let image = tmpdir(build).join(format!("{}-image", name)); - let _ = fs::remove_dir_all(&image); - - let dst = image.join("lib/rustlib/src"); - let dst_src = dst.join("rust"); - t!(fs::create_dir_all(&dst_src)); + // Make sure that the root folder of tarball has the correct name + let plain_name = format!("rustc-{}-src", build.rust_package_vers()); + let plain_dst_src = tmpdir(build).join(&plain_name); + let _ = fs::remove_dir_all(&plain_dst_src); + t!(fs::create_dir_all(&plain_dst_src)); // This is the set of root paths which will become part of the source package let src_files = [ @@ -429,13 +427,13 @@ pub fn rust_src(build: &Build) { // Copy the directories using our filter for item in &src_dirs { - let dst = &dst_src.join(item); + let dst = &plain_dst_src.join(item); t!(fs::create_dir(dst)); cp_filtered(&build.src.join(item), dst, &filter_fn); } // Copy the files normally for item in &src_files { - copy(&build.src.join(item), &dst_src.join(item)); + copy(&build.src.join(item), &plain_dst_src.join(item)); } // If we're building from git sources, we need to vendor a complete distribution. @@ -460,10 +458,63 @@ pub fn rust_src(build: &Build) { // Vendor all Cargo dependencies let mut cmd = Command::new(&build.cargo); cmd.arg("vendor") - .current_dir(&dst_src.join("src")); + .current_dir(&plain_dst_src.join("src")); build.run(&mut cmd); } + // Create the version file + write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes()); + + // Create plain source tarball + let tarball = rust_src_location(build); + if let Some(dir) = tarball.parent() { + t!(fs::create_dir_all(dir)); + } + let mut cmd = Command::new("tar"); + cmd.arg("-czf").arg(sanitize_sh(&tarball)) + .arg(&plain_name) + .current_dir(tmpdir(build)); + build.run(&mut cmd); + + + let name = pkgname(build, "rust-src"); + let image = tmpdir(build).join(format!("{}-image", name)); + let _ = fs::remove_dir_all(&image); + + let dst = image.join("lib/rustlib/src"); + let dst_src = dst.join("rust"); + t!(fs::create_dir_all(&dst_src)); + + // This is the reduced set of paths which will become the rust-src component + // (essentially libstd and all of its path dependencies) + let std_src_dirs = [ + "src/build_helper", + "src/liballoc", + "src/liballoc_jemalloc", + "src/liballoc_system", + "src/libcollections", + "src/libcompiler_builtins", + "src/libcore", + "src/liblibc", + "src/libpanic_abort", + "src/libpanic_unwind", + "src/librand", + "src/librustc_asan", + "src/librustc_lsan", + "src/librustc_msan", + "src/librustc_tsan", + "src/libstd", + "src/libstd_unicode", + "src/libunwind", + "src/rustc/libc_shim", + ]; + + for item in &std_src_dirs { + let dst = &dst_src.join(item); + t!(fs::create_dir_all(dst)); + cp_r(&plain_dst_src.join(item), dst); + } + // Create source tarball in rust-installer format let mut cmd = Command::new(SH_CMD); cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh"))) @@ -478,23 +529,6 @@ pub fn rust_src(build: &Build) { .arg("--legacy-manifest-dirs=rustlib,cargo"); build.run(&mut cmd); - // Rename directory, so that root folder of tarball has the correct name - let plain_name = format!("rustc-{}-src", build.rust_package_vers()); - let plain_dst_src = tmpdir(build).join(&plain_name); - let _ = fs::remove_dir_all(&plain_dst_src); - t!(fs::create_dir_all(&plain_dst_src)); - cp_r(&dst_src, &plain_dst_src); - - // Create the version file - write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes()); - - // Create plain source tarball - let mut cmd = Command::new("tar"); - cmd.arg("-czf").arg(sanitize_sh(&rust_src_location(build))) - .arg(&plain_name) - .current_dir(tmpdir(build)); - build.run(&mut cmd); - t!(fs::remove_dir_all(&image)); t!(fs::remove_dir_all(&plain_dst_src)); } 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/metadata.rs b/src/bootstrap/metadata.rs index 7b6b01655df58..c87e1c16ad33e 100644 --- a/src/bootstrap/metadata.rs +++ b/src/bootstrap/metadata.rs @@ -59,6 +59,7 @@ fn build_krate(build: &mut Build, krate: &str) { let mut cargo = Command::new(&build.cargo); cargo.arg("metadata") .arg("--format-version").arg("1") + .arg("--format-version=1") .arg("--manifest-path").arg(build.src.join(krate).join("Cargo.toml")); let output = output(&mut cargo); let output: Output = json::decode(&output).unwrap(); diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 726e94e49a19e..af3fcd1ec3c26 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -81,7 +81,7 @@ pub fn llvm(build: &Build, target: &str) { // NOTE: remember to also update `config.toml.example` when changing the defaults! let llvm_targets = match build.config.llvm_targets { Some(ref s) => s, - None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX", + None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon", }; let assertions = if build.config.llvm_assertions {"ON"} else {"OFF"}; diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index dab20f44bc361..e01c06b10fcd6 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -139,6 +139,8 @@ pub fn dylib_path_var() -> &'static str { "PATH" } else if cfg!(target_os = "macos") { "DYLD_LIBRARY_PATH" + } else if cfg!(target_os = "haiku") { + "LIBRARY_PATH" } else { "LD_LIBRARY_PATH" } 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/iter/range.rs b/src/libcore/iter/range.rs index 687c477f19e4c..bd831d638c0c4 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -86,12 +86,12 @@ macro_rules! step_impl_unsigned { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 0) + mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 1) + mem::replace(self, 0) } #[inline] @@ -157,12 +157,12 @@ macro_rules! step_impl_signed { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 0) + mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 1) + mem::replace(self, 0) } #[inline] @@ -206,12 +206,12 @@ macro_rules! step_impl_no_between { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 0) + mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 1) + mem::replace(self, 0) } #[inline] 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/libcore/tests/iter.rs b/src/libcore/tests/iter.rs index 08442f9bcbff5..001fa304cd08f 100644 --- a/src/libcore/tests/iter.rs +++ b/src/libcore/tests/iter.rs @@ -1082,3 +1082,41 @@ fn test_chain_fold() { assert_eq!(&[2, 3, 1, 2, 0], &result[..]); } +#[test] +fn test_step_replace_unsigned() { + let mut x = 4u32; + let y = x.replace_zero(); + assert_eq!(x, 0); + assert_eq!(y, 4); + + x = 5; + let y = x.replace_one(); + assert_eq!(x, 1); + assert_eq!(y, 5); +} + +#[test] +fn test_step_replace_signed() { + let mut x = 4i32; + let y = x.replace_zero(); + assert_eq!(x, 0); + assert_eq!(y, 4); + + x = 5; + let y = x.replace_one(); + assert_eq!(x, 1); + assert_eq!(y, 5); +} + +#[test] +fn test_step_replace_no_between() { + let mut x = 4u128; + let y = x.replace_zero(); + assert_eq!(x, 0); + assert_eq!(y, 4); + + x = 5; + let y = x.replace_one(); + assert_eq!(x, 1); + assert_eq!(y, 5); +} \ No newline at end of file diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 528ab3bc84523..f0c46a6f194d5 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -20,6 +20,7 @@ #![feature(fixed_size_array)] #![feature(flt2dec)] #![feature(fmt_internals)] +#![feature(i128_type)] #![feature(iter_rfind)] #![feature(libc)] #![feature(nonzero)] @@ -30,6 +31,7 @@ #![feature(sort_internals)] #![feature(sort_unstable)] #![feature(step_by)] +#![feature(step_trait)] #![feature(test)] #![feature(try_from)] #![feature(unicode)] 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_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs index 38e60060925e6..e6f305c22b2d4 100644 --- a/src/librustc_back/dynamic_lib.rs +++ b/src/librustc_back/dynamic_lib.rs @@ -68,6 +68,8 @@ impl DynamicLibrary { "PATH" } else if cfg!(target_os = "macos") { "DYLD_LIBRARY_PATH" + } else if cfg!(target_os = "haiku") { + "LIBRARY_PATH" } else { "LD_LIBRARY_PATH" } diff --git a/src/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs index bfdc9faaa8a73..8e7f463563c38 100644 --- a/src/librustc_back/target/haiku_base.rs +++ b/src/librustc_back/target/haiku_base.rs @@ -16,9 +16,10 @@ pub fn opts() -> TargetOptions { linker: "cc".to_string(), dynamic_linking: true, executables: true, - has_rpath: true, + has_rpath: false, target_family: Some("unix".to_string()), linker_is_gnu: true, + no_integrated_as: true, .. Default::default() } } diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs index 26417e3ba7cd1..32f0fd4199776 100644 --- a/src/librustc_data_structures/flock.rs +++ b/src/librustc_data_structures/flock.rs @@ -113,6 +113,7 @@ mod imp { pub l_sysid: libc::c_int, } + pub const F_RDLCK: libc::c_short = 0x0040; pub const F_UNLCK: libc::c_short = 0x0200; pub const F_WRLCK: libc::c_short = 0x0400; pub const F_SETLK: libc::c_int = 0x0080; 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_llvm/build.rs b/src/librustc_llvm/build.rs index 4871f60466dfd..3fd75146193e7 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -17,30 +17,24 @@ use std::path::{PathBuf, Path}; use build_helper::output; -fn detect_llvm_link(llvm_config: &Path) -> (&'static str, Option<&'static str>) { - let mut version_cmd = Command::new(llvm_config); - version_cmd.arg("--version"); - let version_output = output(&mut version_cmd); - let mut parts = version_output.split('.').take(2) - .filter_map(|s| s.parse::().ok()); - if let (Some(major), Some(minor)) = (parts.next(), parts.next()) { - if major > 3 || (major == 3 && minor >= 9) { - // Force the link mode we want, preferring static by default, but - // possibly overridden by `configure --enable-llvm-link-shared`. - if env::var_os("LLVM_LINK_SHARED").is_some() { - return ("dylib", Some("--link-shared")); - } else { - return ("static", Some("--link-static")); - } - } else if major == 3 && minor == 8 { - // Find out LLVM's default linking mode. - let mut mode_cmd = Command::new(llvm_config); - mode_cmd.arg("--shared-mode"); - if output(&mut mode_cmd).trim() == "shared" { - return ("dylib", None); - } else { - return ("static", None); - } +fn detect_llvm_link(major: u32, minor: u32, llvm_config: &Path) + -> (&'static str, Option<&'static str>) { + if major > 3 || (major == 3 && minor >= 9) { + // Force the link mode we want, preferring static by default, but + // possibly overridden by `configure --enable-llvm-link-shared`. + if env::var_os("LLVM_LINK_SHARED").is_some() { + return ("dylib", Some("--link-shared")); + } else { + return ("static", Some("--link-static")); + } + } else if major == 3 && minor == 8 { + // Find out LLVM's default linking mode. + let mut mode_cmd = Command::new(llvm_config); + mode_cmd.arg("--shared-mode"); + if output(&mut mode_cmd).trim() == "shared" { + return ("dylib", None); + } else { + return ("static", None); } } ("static", None) @@ -92,9 +86,25 @@ fn main() { let host = env::var("HOST").expect("HOST was not set"); let is_crossed = target != host; - let optional_components = - ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz", "jsbackend", "msp430", - "sparc", "nvptx"]; + let mut optional_components = + vec!["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", + "systemz", "jsbackend", "msp430", "sparc", "nvptx"]; + + let mut version_cmd = Command::new(&llvm_config); + version_cmd.arg("--version"); + let version_output = output(&mut version_cmd); + let mut parts = version_output.split('.').take(2) + .filter_map(|s| s.parse::().ok()); + let (major, minor) = + if let (Some(major), Some(minor)) = (parts.next(), parts.next()) { + (major, minor) + } else { + (3, 7) + }; + + if major > 3 { + optional_components.push("hexagon"); + } // FIXME: surely we don't need all these components, right? Stuff like mcjit // or interpreter the compiler itself never uses. @@ -158,7 +168,7 @@ fn main() { .cpp_link_stdlib(None) // we handle this below .compile("librustllvm.a"); - let (llvm_kind, llvm_link_arg) = detect_llvm_link(&llvm_config); + let (llvm_kind, llvm_link_arg) = detect_llvm_link(major, minor, &llvm_config); // Link in all LLVM libraries, if we're uwring the "wrong" llvm-config then // we don't pick up system libs because unfortunately they're for the host diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 7c52ceae459cd..c9b3a7ff3f3aa 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -382,6 +382,12 @@ pub fn initialize_available_targets() { LLVMInitializeNVPTXTarget, LLVMInitializeNVPTXTargetMC, LLVMInitializeNVPTXAsmPrinter); + init_target!(llvm_component = "hexagon", + LLVMInitializeHexagonTargetInfo, + LLVMInitializeHexagonTarget, + LLVMInitializeHexagonTargetMC, + LLVMInitializeHexagonAsmPrinter, + LLVMInitializeHexagonAsmParser); } pub fn last_error() -> Option { diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index 998e392b1f907..a6b0eb473eb8e 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -29,6 +29,7 @@ use cabi_sparc; use cabi_sparc64; use cabi_nvptx; use cabi_nvptx64; +use cabi_hexagon; use machine::llalign_of_min; use type_::Type; use type_of; @@ -896,6 +897,7 @@ impl<'a, 'tcx> FnType<'tcx> { "sparc64" => cabi_sparc64::compute_abi_info(ccx, self), "nvptx" => cabi_nvptx::compute_abi_info(ccx, self), "nvptx64" => cabi_nvptx64::compute_abi_info(ccx, self), + "hexagon" => cabi_hexagon::compute_abi_info(ccx, self), a => ccx.sess().fatal(&format!("unrecognized arch \"{}\" in target specification", a)) } diff --git a/src/librustc_trans/cabi_hexagon.rs b/src/librustc_trans/cabi_hexagon.rs new file mode 100644 index 0000000000000..1acda72675c31 --- /dev/null +++ b/src/librustc_trans/cabi_hexagon.rs @@ -0,0 +1,43 @@ +// Copyright 2012-2013 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. + +#![allow(non_upper_case_globals)] + +use abi::{FnType, ArgType, LayoutExt}; +use context::CrateContext; + +fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>) { + if ret.layout.is_aggregate() && ret.layout.size(ccx).bits() > 64 { + ret.make_indirect(ccx); + } else { + ret.extend_integer_width_to(32); + } +} + +fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) { + if arg.layout.is_aggregate() && arg.layout.size(ccx).bits() > 64 { + arg.make_indirect(ccx); + } else { + arg.extend_integer_width_to(32); + } +} + +pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fty: &mut FnType<'tcx>) { + if !fty.ret.is_ignore() { + classify_ret_ty(ccx, &mut fty.ret); + } + + for arg in &mut fty.args { + if arg.is_ignore() { + continue; + } + classify_arg_ty(ccx, arg); + } +} diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 117d8568500b8..d5fc2ee5e25e0 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -97,6 +97,7 @@ mod builder; mod cabi_aarch64; mod cabi_arm; mod cabi_asmjs; +mod cabi_hexagon; mod cabi_mips; mod cabi_mips64; mod cabi_msp430; 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 bc315d54100e4..8def11295fda8 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -177,6 +177,13 @@ impl TcpStream { /// /// [`Shutdown`]: ../../std/net/enum.Shutdown.html /// + /// # Platform-specific behavior + /// + /// Calling this function multiple times may result in different behavior, + /// depending on the operating system. On Linux, the second call will + /// return `Ok(())`, but on macOS, it will return `ErrorKind::NotConnected`. + /// This may change in the future. + /// /// # Examples /// /// ```no_run diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1baf0d1b54ce1..afdb0cc4fdb79 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -57,9 +57,11 @@ use tokenstream::{self, Delimited, ThinTokenStream, TokenTree, TokenStream}; use symbol::{Symbol, keywords}; use util::ThinVec; +use std::cmp; use std::collections::HashSet; -use std::{cmp, mem, slice}; +use std::mem; use std::path::{self, Path, PathBuf}; +use std::slice; bitflags! { flags Restrictions: u8 { @@ -5363,24 +5365,25 @@ impl<'a> Parser<'a> { } let mut err = self.diagnostic().struct_span_err(id_sp, "cannot declare a new module at this location"); - let this_module = match self.directory.path.file_name() { - Some(file_name) => file_name.to_str().unwrap().to_owned(), - None => self.root_module_name.as_ref().unwrap().clone(), - }; - err.span_note(id_sp, - &format!("maybe move this module `{0}` to its own directory \ - via `{0}{1}mod.rs`", - this_module, - path::MAIN_SEPARATOR)); + if id_sp != syntax_pos::DUMMY_SP { + let src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp)); + if let Some(stem) = src_path.file_stem() { + let mut dest_path = src_path.clone(); + dest_path.set_file_name(stem); + dest_path.push("mod.rs"); + err.span_note(id_sp, + &format!("maybe move this module `{}` to its own \ + directory via `{}`", src_path.to_string_lossy(), + dest_path.to_string_lossy())); + } + } if paths.path_exists { err.span_note(id_sp, &format!("... or maybe `use` the module `{}` instead \ of possibly redeclaring it", paths.name)); - Err(err) - } else { - Err(err) } + Err(err) } else { paths.result.map_err(|err| self.span_fatal_err(id_sp, err)) } diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs index 9b8099d55a024..be9aa6c5d40ba 100644 --- a/src/libunwind/build.rs +++ b/src/libunwind/build.rs @@ -39,5 +39,7 @@ fn main() { println!("cargo:rustc-link-lib=static-nobundle=pthread"); } else if target.contains("fuchsia") { println!("cargo:rustc-link-lib=unwind"); + } else if target.contains("haiku") { + println!("cargo:rustc-link-lib=gcc_s"); } } diff --git a/src/llvm b/src/llvm index a884d21cc5f0b..878af191434cd 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit a884d21cc5f0b23a1693d1e872fd8998a4fdd17f +Subproject commit 878af191434cd716eeb13c2be7a2b1e21abf2749 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/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index c410a6b1349d6..b938f94cda2cb 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -147,6 +147,12 @@ extern "C" void LLVMRustAddPass(LLVMPassManagerRef PMR, LLVMPassRef RustPass) { #define SUBTARGET_SPARC #endif +#ifdef LLVM_COMPONENT_HEXAGON +#define SUBTARGET_HEXAGON SUBTARGET(Hexagon) +#else +#define SUBTARGET_HEXAGON +#endif + #define GEN_SUBTARGETS \ SUBTARGET_X86 \ SUBTARGET_ARM \ @@ -155,7 +161,8 @@ extern "C" void LLVMRustAddPass(LLVMPassManagerRef PMR, LLVMPassRef RustPass) { SUBTARGET_PPC \ SUBTARGET_SYSTEMZ \ SUBTARGET_MSP430 \ - SUBTARGET_SPARC + SUBTARGET_SPARC \ + SUBTARGET_HEXAGON #define SUBTARGET(x) \ namespace llvm { \ diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index c8732e27b8252..52ebf449d6007 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-03-23 +2017-04-25 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-33287.rs b/src/test/run-pass/issue-33287.rs new file mode 100644 index 0000000000000..a2021e0e52792 --- /dev/null +++ b/src/test/run-pass/issue-33287.rs @@ -0,0 +1,18 @@ +// 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. + +const A: [u32; 1] = [0]; + +fn test() { + let range = A[1]..; +} + +fn main() { } + diff --git a/src/test/ui/invalid-module-declaration/auxiliary/foo/bar.rs b/src/test/ui/invalid-module-declaration/auxiliary/foo/bar.rs new file mode 100644 index 0000000000000..4b6b4f5ebf82f --- /dev/null +++ b/src/test/ui/invalid-module-declaration/auxiliary/foo/bar.rs @@ -0,0 +1,11 @@ +// 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. + +pub mod baz; diff --git a/src/test/ui/invalid-module-declaration/auxiliary/foo/mod.rs b/src/test/ui/invalid-module-declaration/auxiliary/foo/mod.rs new file mode 100644 index 0000000000000..6d77fb60a35de --- /dev/null +++ b/src/test/ui/invalid-module-declaration/auxiliary/foo/mod.rs @@ -0,0 +1,11 @@ +// 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. + +pub mod bar; diff --git a/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs new file mode 100644 index 0000000000000..c15cfb8cc8e22 --- /dev/null +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs @@ -0,0 +1,20 @@ +// Copyright 2016 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. + +// ignore-tidy-linelength + +// error-pattern: cannot declare a new module at this location +// error-pattern: maybe move this module + +mod auxiliary { + mod foo; +} + +fn main() {} diff --git a/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr b/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr new file mode 100644 index 0000000000000..3e9b21cdb740f --- /dev/null +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr @@ -0,0 +1,14 @@ +error: cannot declare a new module at this location + --> $DIR/auxiliary/foo/bar.rs:11:9 + | +11 | pub mod baz; + | ^^^ + | +note: maybe move this module `$DIR/auxiliary/foo/bar.rs` to its own directory via `$DIR/auxiliary/foo/bar/mod.rs` + --> $DIR/auxiliary/foo/bar.rs:11:9 + | +11 | pub mod baz; + | ^^^ + +error: aborting due to previous error + diff --git a/src/tools/cargo b/src/tools/cargo new file mode 160000 index 0000000000000..6c510b0631415 --- /dev/null +++ b/src/tools/cargo @@ -0,0 +1 @@ +Subproject commit 6c510b06314150b58dd6873685f9420a508658ca diff --git a/src/tools/compiletest/src/procsrv.rs b/src/tools/compiletest/src/procsrv.rs index 3d8f2296236a2..dbda8f4d802c0 100644 --- a/src/tools/compiletest/src/procsrv.rs +++ b/src/tools/compiletest/src/procsrv.rs @@ -20,6 +20,8 @@ pub fn dylib_env_var() -> &'static str { "PATH" } else if cfg!(target_os = "macos") { "DYLD_LIBRARY_PATH" + } else if cfg!(target_os = "haiku") { + "LIBRARY_PATH" } else { "LD_LIBRARY_PATH" } diff --git a/src/tools/rls b/src/tools/rls new file mode 160000 index 0000000000000..f4e74d27780b9 --- /dev/null +++ b/src/tools/rls @@ -0,0 +1 @@ +Subproject commit f4e74d27780b914b18308c33f80c79f61b8b1e2f 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)) }