diff --git a/Cargo.lock b/Cargo.lock index f9385ee3a1b..1cfe57da697 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,7 +204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cargo" -version = "0.34.0" +version = "0.35.0" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -212,7 +212,7 @@ dependencies = [ "bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crates-io 0.22.0", + "crates-io 0.23.0", "crossbeam-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", @@ -496,7 +496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "crates-io" -version = "0.22.0" +version = "0.23.0" dependencies = [ "curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2113,7 +2113,7 @@ dependencies = [ name = "rls" version = "1.31.6" dependencies = [ - "cargo 0.34.0", + "cargo 0.35.0", "cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "clippy_lints 0.0.212", "crossbeam-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index a69ba207495..f742bce180c 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -21,7 +21,7 @@ use crate::install; use crate::native; use crate::test; use crate::tool; -use crate::util::{add_lib_path, exe, libdir}; +use crate::util::{self, add_lib_path, exe, libdir}; use crate::{Build, DocTests, Mode, GitRepo}; pub use crate::Compiler; @@ -791,6 +791,13 @@ impl<'a> Builder<'a> { .env("CARGO_TARGET_DIR", out_dir) .arg(cmd); + // See comment in librustc_llvm/build.rs for why this is necessary, largely llvm-config + // needs to not accidentally link to libLLVM in stage0/lib. + cargo.env("REAL_LIBRARY_PATH_VAR", &util::dylib_path_var()); + if let Some(e) = env::var_os(util::dylib_path_var()) { + cargo.env("REAL_LIBRARY_PATH", e); + } + if cmd != "install" { cargo.arg("--target") .arg(target); diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index 63741b9b677..0b2f62485c9 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -14,7 +14,7 @@ use crate::Build; use crate::config::Config; // The version number -pub const CFG_RELEASE_NUM: &str = "1.33.0"; +pub const CFG_RELEASE_NUM: &str = "1.34.0"; pub struct GitInfo { inner: Option, diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index b581271663e..ec04dee6c32 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -712,6 +712,7 @@ pub fn build_codegen_backend(builder: &Builder, if builder.is_rust_llvm(target) && backend != "emscripten" { cargo.env("LLVM_RUSTLLVM", "1"); } + cargo.env("LLVM_CONFIG", &llvm_config); if backend != "emscripten" { let target_config = builder.config.target_config.get(&target); diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 98d2fb1e2d0..116b2720f39 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -226,7 +226,7 @@ fn make_win_dist( let trim_chars: &[_] = &[' ', '=']; let value = line[(idx + 1)..] - .trim_left_matches(trim_chars) + .trim_start_matches(trim_chars) .split(';') .map(PathBuf::from); diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 37451a74dfa..32b03c5fb1b 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -423,7 +423,7 @@ impl Build { Command::new(&build.initial_rustc).arg("--version").arg("--verbose")); let local_release = local_version_verbose .lines().filter(|x| x.starts_with("release:")) - .next().unwrap().trim_left_matches("release:").trim(); + .next().unwrap().trim_start_matches("release:").trim(); let my_version = channel::CFG_RELEASE_NUM; if local_release.split('.').take(2).eq(my_version.split('.').take(2)) { build.verbose(&format!("auto-detected local-rebuild {}", local_release)); diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index 2880f1a084b..37c6c040da8 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -70,7 +70,11 @@ pub fn dylib_path_var() -> &'static str { /// Parses the `dylib_path_var()` environment variable, returning a list of /// paths that are members of this lookup path. pub fn dylib_path() -> Vec { - env::split_paths(&env::var_os(dylib_path_var()).unwrap_or_default()).collect() + let var = match env::var_os(dylib_path_var()) { + Some(v) => v, + None => return vec![], + }; + env::split_paths(&var).collect() } /// `push` all components to `buf`. On windows, append `.exe` to the last component. diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs index 5a704e55775..c66c5c92490 100644 --- a/src/build_helper/lib.rs +++ b/src/build_helper/lib.rs @@ -23,6 +23,25 @@ macro_rules! t { }; } +// Because Cargo adds the compiler's dylib path to our library search path, llvm-config may +// break: the dylib path for the compiler, as of this writing, contains a copy of the LLVM +// shared library, which means that when our freshly built llvm-config goes to load it's +// associated LLVM, it actually loads the compiler's LLVM. In particular when building the first +// compiler (i.e., in stage 0) that's a problem, as the compiler's LLVM is likely different from +// the one we want to use. As such, we restore the environment to what bootstrap saw. This isn't +// perfect -- we might actually want to see something from Cargo's added library paths -- but +// for now it works. +pub fn restore_library_path() { + println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH_VAR"); + println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH"); + let key = env::var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR"); + if let Some(env) = env::var_os("REAL_LIBRARY_PATH") { + env::set_var(&key, &env); + } else { + env::remove_var(&key); + } +} + pub fn run(cmd: &mut Command) { println!("running: {:?}", cmd); run_silent(cmd); diff --git a/src/liballoc/benches/vec_deque_append.rs b/src/liballoc/benches/vec_deque_append.rs index 2db8fbe1309..78ec91d9e3e 100644 --- a/src/liballoc/benches/vec_deque_append.rs +++ b/src/liballoc/benches/vec_deque_append.rs @@ -1,4 +1,3 @@ -#![cfg_attr(stage0, feature(duration_as_u128))] use std::{collections::VecDeque, time::Instant}; const VECDEQUE_LEN: i32 = 100000; diff --git a/src/liballoc/tests/binary_heap.rs b/src/liballoc/tests/binary_heap.rs index 6af1cf40809..94ae43237d1 100644 --- a/src/liballoc/tests/binary_heap.rs +++ b/src/liballoc/tests/binary_heap.rs @@ -2,7 +2,7 @@ use std::cmp; use std::collections::BinaryHeap; use std::collections::binary_heap::{Drain, PeekMut}; use std::panic::{self, AssertUnwindSafe}; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use rand::{thread_rng, seq::SliceRandom}; @@ -283,7 +283,7 @@ fn assert_covariance() { // Destructors must be called exactly once per element. #[test] fn panic_safe() { - static DROP_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT; + static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0); #[derive(Eq, PartialEq, Ord, Clone, Debug)] struct PanicOrd(T, bool); diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs index 8ecd17236c0..0300bd7f3f6 100644 --- a/src/liballoc/tests/slice.rs +++ b/src/liballoc/tests/slice.rs @@ -5,7 +5,7 @@ use std::mem; use std::panic; use std::rc::Rc; use std::sync::atomic::Ordering::Relaxed; -use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize}; +use std::sync::atomic::AtomicUsize; use std::thread; use rand::{Rng, RngCore, thread_rng, seq::SliceRandom}; @@ -1500,7 +1500,7 @@ static DROP_COUNTS: [AtomicUsize; MAX_LEN] = [ AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), ]; -static VERSIONS: AtomicUsize = ATOMIC_USIZE_INIT; +static VERSIONS: AtomicUsize = AtomicUsize::new(0); #[derive(Clone, Eq)] struct DropCounter { diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index db19baf7a2c..e66a8465370 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -692,7 +692,6 @@ extern "rust-intrinsic" { /// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited: /// This will statically either panic, or do nothing. - #[cfg(not(stage0))] pub fn panic_if_uninhabited(); /// Creates a value initialized to zero. diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index df32cfa3373..45ef7fe70a0 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -71,7 +71,6 @@ #![feature(cfg_target_has_atomic)] #![feature(concat_idents)] #![feature(const_fn)] -#![cfg_attr(stage0, feature(const_int_ops))] #![feature(const_fn_union)] #![feature(custom_attribute)] #![feature(doc_cfg)] @@ -112,19 +111,17 @@ #![feature(aarch64_target_feature)] #![feature(wasm_target_feature)] #![feature(avx512_target_feature)] -#![cfg_attr(not(stage0), feature(cmpxchg16b_target_feature))] +#![feature(cmpxchg16b_target_feature)] #![feature(const_slice_len)] #![feature(const_str_as_bytes)] #![feature(const_str_len)] -#![cfg_attr(stage0, feature(const_let))] -#![cfg_attr(stage0, feature(const_int_rotate))] #![feature(const_int_conversion)] #![feature(const_transmute)] #![feature(reverse_bits)] #![feature(non_exhaustive)] #![feature(structural_match)] #![feature(abi_unadjusted)] -#![cfg_attr(not(stage0), feature(adx_target_feature))] +#![feature(adx_target_feature)] #[prelude_import] #[allow(unused)] diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 0b6fb0db1d6..0eeac5e1ea9 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -491,7 +491,6 @@ pub const fn needs_drop() -> bool { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub unsafe fn zeroed() -> T { - #[cfg(not(stage0))] intrinsics::panic_if_uninhabited::(); intrinsics::init() } @@ -625,7 +624,6 @@ pub unsafe fn zeroed() -> T { #[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::uninitialized` instead")] #[stable(feature = "rust1", since = "1.0.0")] pub unsafe fn uninitialized() -> T { - #[cfg(not(stage0))] intrinsics::panic_if_uninhabited::(); intrinsics::uninit() } @@ -1104,7 +1102,6 @@ impl MaybeUninit { #[unstable(feature = "maybe_uninit", issue = "53491")] #[inline(always)] pub unsafe fn into_inner(self) -> T { - #[cfg(not(stage0))] intrinsics::panic_if_uninhabited::(); ManuallyDrop::into_inner(self.value) } diff --git a/src/libcore/num/bignum.rs b/src/libcore/num/bignum.rs index 5326ef1e7c1..c3a42a0fc04 100644 --- a/src/libcore/num/bignum.rs +++ b/src/libcore/num/bignum.rs @@ -46,17 +46,6 @@ macro_rules! impl_full_ops { ($($ty:ty: add($addfn:path), mul/div($bigty:ident);)*) => ( $( impl FullOps for $ty { - #[cfg(stage0)] - fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) { - // This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`. - // FIXME: will LLVM optimize this into ADC or similar? - let (v, carry1) = unsafe { intrinsics::add_with_overflow(self, other) }; - let (v, carry2) = unsafe { - intrinsics::add_with_overflow(v, if carry {1} else {0}) - }; - (carry1 || carry2, v) - } - #[cfg(not(stage0))] fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) { // This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`. // FIXME: will LLVM optimize this into ADC or similar? diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 423b800d585..7cf2317f4b3 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -281,7 +281,6 @@ $EndFeature, " ``` "), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn count_ones(self) -> u32 { (self as $UnsignedT).count_ones() } } @@ -297,7 +296,6 @@ Basic usage: ", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 1);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn count_zeros(self) -> u32 { (!self).count_ones() @@ -318,7 +316,6 @@ assert_eq!(n.leading_zeros(), 0);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn leading_zeros(self) -> u32 { (self as $UnsignedT).leading_zeros() @@ -339,7 +336,6 @@ assert_eq!(n.trailing_zeros(), 2);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn trailing_zeros(self) -> u32 { (self as $UnsignedT).trailing_zeros() @@ -363,7 +359,6 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_left(self, n: u32) -> Self { (self as $UnsignedT).rotate_left(n) as Self @@ -388,7 +383,6 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_right(self, n: u32) -> Self { (self as $UnsignedT).rotate_right(n) as Self @@ -410,7 +404,6 @@ let m = n.swap_bytes(); assert_eq!(m, ", $swapped, "); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn swap_bytes(self) -> Self { (self as $UnsignedT).swap_bytes() as Self @@ -460,7 +453,6 @@ if cfg!(target_endian = \"big\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn from_be(x: Self) -> Self { #[cfg(target_endian = "big")] @@ -494,7 +486,6 @@ if cfg!(target_endian = \"little\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn from_le(x: Self) -> Self { #[cfg(target_endian = "little")] @@ -528,7 +519,6 @@ if cfg!(target_endian = \"big\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn to_be(self) -> Self { // or not to be? #[cfg(target_endian = "big")] @@ -562,7 +552,6 @@ if cfg!(target_endian = \"little\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn to_le(self) -> Self { #[cfg(target_endian = "little")] @@ -998,14 +987,8 @@ assert_eq!(", stringify!($SelfT), "::max_value().wrapping_add(2), ", stringify!( $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_add(self, rhs: Self) -> Self { - #[cfg(stage0)] - unsafe { - intrinsics::overflowing_add(self, rhs) - } - #[cfg(not(stage0))] intrinsics::overflowing_add(self, rhs) } } @@ -1025,14 +1008,8 @@ stringify!($SelfT), "::max_value());", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_sub(self, rhs: Self) -> Self { - #[cfg(stage0)] - unsafe { - intrinsics::overflowing_sub(self, rhs) - } - #[cfg(not(stage0))] intrinsics::overflowing_sub(self, rhs) } } @@ -1051,14 +1028,8 @@ assert_eq!(11i8.wrapping_mul(12), -124);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_mul(self, rhs: Self) -> Self { - #[cfg(stage0)] - unsafe { - intrinsics::overflowing_mul(self, rhs) - } - #[cfg(not(stage0))] intrinsics::overflowing_mul(self, rhs) } } @@ -1218,7 +1189,6 @@ assert_eq!((-1", stringify!($SelfT), ").wrapping_shl(128), -1);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_shl(self, rhs: u32) -> Self { unsafe { @@ -1246,7 +1216,6 @@ assert_eq!((-128i16).wrapping_shr(64), -128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_shr(self, rhs: u32) -> Self { unsafe { @@ -1343,14 +1312,8 @@ assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($Sel "::MIN, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) { - #[cfg(stage0)] - let (a, b) = unsafe { - intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT) - }; - #[cfg(not(stage0))] let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); (a as Self, b) } @@ -1374,14 +1337,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($Sel "::MAX, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) { - #[cfg(stage0)] - let (a, b) = unsafe { - intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT) - }; - #[cfg(not(stage0))] let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT); (a as Self, b) } @@ -1403,14 +1360,8 @@ assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) { - #[cfg(stage0)] - let (a, b) = unsafe { - intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT) - }; - #[cfg(not(stage0))] let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT); (a as Self, b) } @@ -1594,7 +1545,6 @@ assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) { (self.wrapping_shl(rhs), (rhs > ($BITS - 1))) @@ -1618,7 +1568,6 @@ assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) { (self.wrapping_shr(rhs), (rhs > ($BITS - 1))) @@ -2242,13 +2191,9 @@ Basic usage: assert_eq!(n.count_ones(), 3);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn count_ones(self) -> u32 { - #[cfg(stage0)] - unsafe { intrinsics::ctpop(self as $ActualT) as u32 } - #[cfg(not(stage0))] - { intrinsics::ctpop(self as $ActualT) as u32 } + intrinsics::ctpop(self as $ActualT) as u32 } } @@ -2263,7 +2208,6 @@ Basic usage: ", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 0);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn count_zeros(self) -> u32 { (!self).count_ones() @@ -2283,13 +2227,9 @@ Basic usage: assert_eq!(n.leading_zeros(), 2);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn leading_zeros(self) -> u32 { - #[cfg(stage0)] - unsafe { intrinsics::ctlz(self as $ActualT) as u32 } - #[cfg(not(stage0))] - { intrinsics::ctlz(self as $ActualT) as u32 } + intrinsics::ctlz(self as $ActualT) as u32 } } @@ -2307,13 +2247,9 @@ Basic usage: assert_eq!(n.trailing_zeros(), 3);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn trailing_zeros(self) -> u32 { - #[cfg(stage0)] - unsafe { intrinsics::cttz(self) as u32 } - #[cfg(not(stage0))] - { intrinsics::cttz(self) as u32 } + intrinsics::cttz(self) as u32 } } @@ -2334,12 +2270,8 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_left(self, n: u32) -> Self { - #[cfg(stage0)] - unsafe { intrinsics::rotate_left(self, n as $SelfT) } - #[cfg(not(stage0))] intrinsics::rotate_left(self, n as $SelfT) } } @@ -2362,12 +2294,8 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_right(self, n: u32) -> Self { - #[cfg(stage0)] - unsafe { intrinsics::rotate_right(self, n as $SelfT) } - #[cfg(not(stage0))] intrinsics::rotate_right(self, n as $SelfT) } } @@ -2387,13 +2315,9 @@ let m = n.swap_bytes(); assert_eq!(m, ", $swapped, "); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn swap_bytes(self) -> Self { - #[cfg(stage0)] - unsafe { intrinsics::bswap(self as $ActualT) as Self } - #[cfg(not(stage0))] - { intrinsics::bswap(self as $ActualT) as Self } + intrinsics::bswap(self as $ActualT) as Self } } @@ -2413,13 +2337,9 @@ let m = n.reverse_bits(); assert_eq!(m, ", $reversed, "); ```"), #[unstable(feature = "reverse_bits", issue = "48763")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_conversion"))] #[inline] pub const fn reverse_bits(self) -> Self { - #[cfg(stage0)] - unsafe { intrinsics::bitreverse(self as $ActualT) as Self } - #[cfg(not(stage0))] - { intrinsics::bitreverse(self as $ActualT) as Self } + intrinsics::bitreverse(self as $ActualT) as Self } } @@ -2443,7 +2363,6 @@ if cfg!(target_endian = \"big\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn from_be(x: Self) -> Self { #[cfg(target_endian = "big")] @@ -2477,7 +2396,6 @@ if cfg!(target_endian = \"little\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn from_le(x: Self) -> Self { #[cfg(target_endian = "little")] @@ -2511,7 +2429,6 @@ if cfg!(target_endian = \"big\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn to_be(self) -> Self { // or not to be? #[cfg(target_endian = "big")] @@ -2545,7 +2462,6 @@ if cfg!(target_endian = \"little\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))] #[inline] pub const fn to_le(self) -> Self { #[cfg(target_endian = "little")] @@ -2918,14 +2834,8 @@ assert_eq!(200", stringify!($SelfT), ".wrapping_add(", stringify!($SelfT), "::ma $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_add(self, rhs: Self) -> Self { - #[cfg(stage0)] - unsafe { - intrinsics::overflowing_add(self, rhs) - } - #[cfg(not(stage0))] intrinsics::overflowing_add(self, rhs) } } @@ -2944,14 +2854,8 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_sub(", stringify!($SelfT), "::ma $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_sub(self, rhs: Self) -> Self { - #[cfg(stage0)] - unsafe { - intrinsics::overflowing_sub(self, rhs) - } - #[cfg(not(stage0))] intrinsics::overflowing_sub(self, rhs) } } @@ -2971,14 +2875,8 @@ $EndFeature, " /// assert_eq!(25u8.wrapping_mul(12), 44); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_mul(self, rhs: Self) -> Self { - #[cfg(stage0)] - unsafe { - intrinsics::overflowing_mul(self, rhs) - } - #[cfg(not(stage0))] intrinsics::overflowing_mul(self, rhs) } @@ -3124,7 +3022,6 @@ Basic usage: assert_eq!(1", stringify!($SelfT), ".wrapping_shl(128), 1);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_shl(self, rhs: u32) -> Self { unsafe { @@ -3154,7 +3051,6 @@ Basic usage: assert_eq!(128", stringify!($SelfT), ".wrapping_shr(128), 128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))] #[inline] pub const fn wrapping_shr(self, rhs: u32) -> Self { unsafe { @@ -3218,14 +3114,8 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false)); assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) { - #[cfg(stage0)] - let (a, b) = unsafe { - intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT) - }; - #[cfg(not(stage0))] let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); (a as Self, b) } @@ -3250,14 +3140,8 @@ assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT), $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) { - #[cfg(stage0)] - let (a, b) = unsafe { - intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT) - }; - #[cfg(not(stage0))] let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT); (a as Self, b) } @@ -3281,14 +3165,8 @@ $EndFeature, " /// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true)); /// ``` #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) { - #[cfg(stage0)] - let (a, b) = unsafe { - intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT) - }; - #[cfg(not(stage0))] let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT); (a as Self, b) } @@ -3447,7 +3325,6 @@ Basic usage assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(132), (0x10, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) { (self.wrapping_shl(rhs), (rhs > ($BITS - 1))) @@ -3472,7 +3349,6 @@ Basic usage assert_eq!(0x10", stringify!($SelfT), ".overflowing_shr(132), (0x1, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))] #[inline] pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) { (self.wrapping_shr(rhs), (rhs > ($BITS - 1))) diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs index bec3a155c18..eb76c2de11b 100644 --- a/src/libcore/ops/deref.rs +++ b/src/libcore/ops/deref.rs @@ -171,7 +171,7 @@ impl DerefMut for &mut T { /// Indicates that a struct can be used as a method receiver, without the /// `arbitrary_self_types` feature. This is implemented by stdlib pointer types like `Box`, /// `Rc`, `&T`, and `Pin

`. -#[cfg_attr(not(stage0), lang = "receiver")] +#[lang = "receiver"] #[unstable(feature = "receiver_trait", issue = "0")] #[doc(hidden)] pub trait Receiver { diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index b9ebf19b23c..bcedff5abc7 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -2413,12 +2413,11 @@ pub fn fence(order: Ordering) { /// /// ``` /// use std::sync::atomic::{AtomicBool, AtomicUsize}; -/// use std::sync::atomic::{ATOMIC_BOOL_INIT, ATOMIC_USIZE_INIT}; /// use std::sync::atomic::Ordering; /// use std::sync::atomic::compiler_fence; /// -/// static IMPORTANT_VARIABLE: AtomicUsize = ATOMIC_USIZE_INIT; -/// static IS_READY: AtomicBool = ATOMIC_BOOL_INIT; +/// static IMPORTANT_VARIABLE: AtomicUsize = AtomicUsize::new(0); +/// static IS_READY: AtomicBool = AtomicBool::new(false); /// /// fn main() { /// IMPORTANT_VARIABLE.store(42, Ordering::Relaxed); diff --git a/src/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs index 8832a16d4ca..f6306d23c30 100644 --- a/src/libpanic_abort/lib.rs +++ b/src/libpanic_abort/lib.rs @@ -12,7 +12,6 @@ #![panic_runtime] #![allow(unused_features)] -#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(core_intrinsics)] #![feature(libc)] #![feature(nll)] diff --git a/src/librustc_asan/build.rs b/src/librustc_asan/build.rs index 2d921b66694..b42d775deb3 100644 --- a/src/librustc_asan/build.rs +++ b/src/librustc_asan/build.rs @@ -8,6 +8,8 @@ use cmake::Config; fn main() { if let Some(llvm_config) = env::var_os("LLVM_CONFIG") { + build_helper::restore_library_path(); + let (native, target) = match sanitizer_lib_boilerplate("asan") { Ok(native) => native, _ => return, diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index abcdf175ada..a95ce810ffa 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -91,7 +91,7 @@ use std::panic; use std::path::{PathBuf, Path}; use std::process::{self, Command, Stdio}; use std::str; -use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Once, ONCE_INIT}; use std::thread; @@ -254,7 +254,7 @@ fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box { // general this assertion never trips due to the once guard in `get_codegen_backend`, // but there's a few manual calls to this function in this file we protect // against. - static LOADED: AtomicBool = ATOMIC_BOOL_INIT; + static LOADED: AtomicBool = AtomicBool::new(false); assert!(!LOADED.fetch_or(true, Ordering::SeqCst), "cannot load the default codegen backend twice"); diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index ec3dff783c4..cd91fcb2995 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -24,6 +24,8 @@ fn main() { return; } + build_helper::restore_library_path(); + let target = env::var("TARGET").expect("TARGET was not set"); let llvm_config = env::var_os("LLVM_CONFIG") .map(PathBuf::from) diff --git a/src/librustc_lsan/build.rs b/src/librustc_lsan/build.rs index 470f2bb3e5c..ad528bb0390 100644 --- a/src/librustc_lsan/build.rs +++ b/src/librustc_lsan/build.rs @@ -8,6 +8,8 @@ use cmake::Config; fn main() { if let Some(llvm_config) = env::var_os("LLVM_CONFIG") { + build_helper::restore_library_path(); + let (native, target) = match sanitizer_lib_boilerplate("lsan") { Ok(native) => native, _ => return, diff --git a/src/librustc_mir/diagnostics.rs b/src/librustc_mir/diagnostics.rs index ea9e19c75c2..74394165a5f 100644 --- a/src/librustc_mir/diagnostics.rs +++ b/src/librustc_mir/diagnostics.rs @@ -1127,9 +1127,9 @@ A borrow of a constant containing interior mutability was attempted. Erroneous code example: ```compile_fail,E0492 -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT}; +use std::sync::atomic::AtomicUsize; -const A: AtomicUsize = ATOMIC_USIZE_INIT; +const A: AtomicUsize = AtomicUsize::new(0); static B: &'static AtomicUsize = &A; // error: cannot borrow a constant which may contain interior mutability, // create a static instead @@ -1145,9 +1145,9 @@ explicitly a single memory location, which can be mutated at will. So, in order to solve this error, either use statics which are `Sync`: ``` -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT}; +use std::sync::atomic::AtomicUsize; -static A: AtomicUsize = ATOMIC_USIZE_INIT; +static A: AtomicUsize = AtomicUsize::new(0); static B: &'static AtomicUsize = &A; // ok! ``` diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 9395da60b38..ccfc15bac04 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -24,10 +24,8 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![feature(unicode_internals)] #![feature(step_trait)] #![feature(slice_concat_ext)] -#![cfg_attr(stage0, feature(if_while_or_patterns))] #![feature(try_from)] #![feature(reverse_bits)] -#![cfg_attr(stage0, feature(underscore_imports))] #![recursion_limit="256"] diff --git a/src/librustc_msan/build.rs b/src/librustc_msan/build.rs index e1140278f2b..085514b5a01 100644 --- a/src/librustc_msan/build.rs +++ b/src/librustc_msan/build.rs @@ -8,6 +8,8 @@ use cmake::Config; fn main() { if let Some(llvm_config) = env::var_os("LLVM_CONFIG") { + build_helper::restore_library_path(); + let (native, target) = match sanitizer_lib_boilerplate("msan") { Ok(native) => native, _ => return, diff --git a/src/librustc_tsan/build.rs b/src/librustc_tsan/build.rs index f63bb46b874..0db3db392dd 100644 --- a/src/librustc_tsan/build.rs +++ b/src/librustc_tsan/build.rs @@ -8,6 +8,8 @@ use cmake::Config; fn main() { if let Some(llvm_config) = env::var_os("LLVM_CONFIG") { + build_helper::restore_library_path(); + let (native, target) = match sanitizer_lib_boilerplate("tsan") { Ok(native) => native, _ => return, diff --git a/src/libstd/alloc.rs b/src/libstd/alloc.rs index 537f56a8da7..8b6e5680c2d 100644 --- a/src/libstd/alloc.rs +++ b/src/libstd/alloc.rs @@ -95,11 +95,11 @@ pub use alloc_crate::alloc::*; /// /// ```rust /// use std::alloc::{System, GlobalAlloc, Layout}; -/// use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering::SeqCst}; +/// use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; /// /// struct Counter; /// -/// static ALLOCATED: AtomicUsize = ATOMIC_USIZE_INIT; +/// static ALLOCATED: AtomicUsize = AtomicUsize::new(0); /// /// unsafe impl GlobalAlloc for Counter { /// unsafe fn alloc(&self, layout: Layout) -> *mut u8 { diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 82f3463dba0..c94a33da037 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -234,12 +234,9 @@ #![feature(c_variadic)] #![feature(cfg_target_has_atomic)] #![feature(cfg_target_thread_local)] -#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(char_error_internals)] #![feature(compiler_builtins_lib)] #![feature(concat_idents)] -#![cfg_attr(stage0, feature(const_int_ops))] -#![cfg_attr(stage0, feature(const_ip))] #![feature(const_raw_ptr_deref)] #![feature(const_cstr_unchecked)] #![feature(core_intrinsics)] diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index f98113e0896..f45cd8b8c10 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -328,7 +328,6 @@ impl Ipv4Addr { /// let addr = Ipv4Addr::new(127, 0, 0, 1); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(stage0, rustc_const_unstable(feature = "const_ip"))] pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { Ipv4Addr { inner: c::in_addr { diff --git a/src/libstd/sys/redox/thread_local.rs b/src/libstd/sys/redox/thread_local.rs index a1c4b10e450..a1929b94165 100644 --- a/src/libstd/sys/redox/thread_local.rs +++ b/src/libstd/sys/redox/thread_local.rs @@ -2,13 +2,13 @@ use collections::BTreeMap; use ptr; -use sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use sync::atomic::{AtomicUsize, Ordering}; pub type Key = usize; type Dtor = unsafe extern fn(*mut u8); -static NEXT_KEY: AtomicUsize = ATOMIC_USIZE_INIT; +static NEXT_KEY: AtomicUsize = AtomicUsize::new(0); static mut KEYS: *mut BTreeMap> = ptr::null_mut(); diff --git a/src/libstd/sys/sgx/abi/tls.rs b/src/libstd/sys/sgx/abi/tls.rs index aba93db915f..b8e09d58deb 100644 --- a/src/libstd/sys/sgx/abi/tls.rs +++ b/src/libstd/sys/sgx/abi/tls.rs @@ -1,4 +1,4 @@ -use sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use sync::atomic::{AtomicUsize, Ordering}; use ptr; use mem; use cell::Cell; @@ -15,7 +15,40 @@ macro_rules! dup { ((* $($exp:tt)*) $($val:tt)*) => (dup!( ($($exp)*) $($val)* $($val)* )); (() $($val:tt)*) => ([$($val),*]) } -static TLS_DESTRUCTOR: [AtomicUsize; TLS_KEYS] = dup!((* * * * * * *) ATOMIC_USIZE_INIT); +static TLS_DESTRUCTOR: [AtomicUsize; TLS_KEYS] = [ + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), + AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), +]; extern "C" { fn get_tls_ptr() -> *const u8; @@ -119,7 +152,7 @@ impl Tls { } mod sync_bitset { - use sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; + use sync::atomic::{AtomicUsize, Ordering}; use iter::{Enumerate, Peekable}; use slice::Iter; use super::{TLS_KEYS_BITSET_SIZE, USIZE_BITS}; @@ -128,7 +161,7 @@ mod sync_bitset { pub(super) struct SyncBitset([AtomicUsize; TLS_KEYS_BITSET_SIZE]); pub(super) const SYNC_BITSET_INIT: SyncBitset = - SyncBitset([ATOMIC_USIZE_INIT, ATOMIC_USIZE_INIT]); + SyncBitset([AtomicUsize::new(0), AtomicUsize::new(0)]); impl SyncBitset { pub fn get(&self, index: usize) -> bool { diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 91793a0d5ec..a746d982c6c 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -1,7 +1,7 @@ use io; use libc::{self, c_int}; use mem; -use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; +use sync::atomic::{AtomicBool, Ordering}; use sys::fd::FileDesc; use sys::{cvt, cvt_r}; @@ -13,7 +13,7 @@ pub struct AnonPipe(FileDesc); pub fn anon_pipe() -> io::Result<(AnonPipe, AnonPipe)> { syscall! { fn pipe2(fds: *mut c_int, flags: c_int) -> c_int } - static INVALID: AtomicBool = ATOMIC_BOOL_INIT; + static INVALID: AtomicBool = AtomicBool::new(false); let mut fds = [0; 2]; diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index 2b1dbe310ee..0d9195a5c97 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -7,7 +7,7 @@ use path::Path; use ptr; use slice; use sync::atomic::Ordering::SeqCst; -use sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT}; +use sync::atomic::AtomicUsize; use sys::c; use sys::fs::{File, OpenOptions}; use sys::handle::Handle; @@ -148,7 +148,7 @@ pub fn anon_pipe(ours_readable: bool) -> io::Result { } fn random_number() -> usize { - static N: AtomicUsize = ATOMIC_USIZE_INIT; + static N: AtomicUsize = AtomicUsize::new(0); loop { if N.load(SeqCst) != 0 { return N.fetch_add(1, SeqCst) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index fc03e685b6f..c8eceeeaa5a 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -23,7 +23,6 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))] #![feature(asm)] -#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(fnbox)] #![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc, rustc_private))] #![feature(nll)] diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 7ed7837268d..5f9c82431b7 100644 --- a/src/libunwind/lib.rs +++ b/src/libunwind/lib.rs @@ -1,7 +1,6 @@ #![no_std] #![unstable(feature = "panic_unwind", issue = "32837")] -#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(link_cfg)] #![feature(nll)] #![feature(staged_api)] diff --git a/src/stage0.txt b/src/stage0.txt index 2e376ed1ced..36d30b7d273 100644 --- a/src/stage0.txt +++ b/src/stage0.txt @@ -12,7 +12,7 @@ # 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`. -date: 2019-01-04 +date: 2019-01-18 rustc: beta cargo: beta diff --git a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile index 0a6f226a027..4f33b1c59e0 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile @@ -1,6 +1,9 @@ - -include ../tools.mk +# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same +# (so fixing it is harder). See #57765 for context +ifndef IS_WINDOWS + # This test makes sure that we don't loose upstream object files when compiling # staticlibs with -Zcross-lang-lto @@ -9,7 +12,7 @@ all: staticlib.rs upstream.rs # Check No LTO $(RUSTC) staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a - (cd $(TMPDIR); llvm-ar x ./staticlib.a) + (cd $(TMPDIR); $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x ./staticlib.a) # Make sure the upstream object file was included ls $(TMPDIR)/upstream.*.rcgu.o @@ -19,5 +22,11 @@ all: staticlib.rs upstream.rs # Check ThinLTO $(RUSTC) upstream.rs -Z cross-lang-lto -Ccodegen-units=1 -Clto=thin $(RUSTC) staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a - (cd $(TMPDIR); llvm-ar x ./staticlib.a) + (cd $(TMPDIR); $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x ./staticlib.a) ls $(TMPDIR)/upstream.*.rcgu.o + +else + +all: + +endif diff --git a/src/test/run-make-fulldeps/cross-lang-lto/Makefile b/src/test/run-make-fulldeps/cross-lang-lto/Makefile index 1d072e03de3..57a19a0ccb0 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto/Makefile @@ -1,12 +1,17 @@ -include ../tools.mk +# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same +# (so fixing it is harder). See #57765 for context +ifndef IS_WINDOWS + # This test makes sure that the object files we generate are actually # LLVM bitcode files (as used by linker LTO plugins) when compiling with # -Z cross-lang-lto. -ASSERT_IS_BITCODE_OBJ=llvm-bcanalyzer # this only succeeds for bitcode files -EXTRACT_OBJS=(cd $(TMPDIR); rm -f ./*.o; llvm-ar x $(1)) +# this only succeeds for bitcode files +ASSERT_IS_BITCODE_OBJ=($(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-bcanalyzer $(1)) +EXTRACT_OBJS=(cd $(TMPDIR); rm -f ./*.o; $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x $(1)) BUILD_LIB=$(RUSTC) lib.rs -Copt-level=2 -Z cross-lang-lto=on -Ccodegen-units=1 BUILD_EXE=$(RUSTC) main.rs -Copt-level=2 -Z cross-lang-lto=on -Ccodegen-units=1 --emit=obj @@ -16,31 +21,37 @@ all: staticlib staticlib-fat-lto staticlib-thin-lto rlib exe cdylib rdylib staticlib: lib.rs $(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib.a $(call EXTRACT_OBJS, liblib.a) - for file in $(TMPDIR)/liblib.*.rcgu.o; do $(ASSERT_IS_BITCODE_OBJ) $$file; done + for file in $(TMPDIR)/liblib.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done staticlib-fat-lto: lib.rs $(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib-fat-lto.a -Clto=fat $(call EXTRACT_OBJS, liblib-fat-lto.a) - for file in $(TMPDIR)/liblib-fat-lto.*.rcgu.o; do $(ASSERT_IS_BITCODE_OBJ) $$file; done + for file in $(TMPDIR)/liblib-fat-lto.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done staticlib-thin-lto: lib.rs $(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib-thin-lto.a -Clto=thin $(call EXTRACT_OBJS, liblib-thin-lto.a) - for file in $(TMPDIR)/liblib-thin-lto.*.rcgu.o; do $(ASSERT_IS_BITCODE_OBJ) $$file; done + for file in $(TMPDIR)/liblib-thin-lto.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done rlib: lib.rs $(BUILD_LIB) --crate-type=rlib -o $(TMPDIR)/liblib.rlib $(call EXTRACT_OBJS, liblib.rlib) - for file in $(TMPDIR)/liblib.*.rcgu.o; do $(ASSERT_IS_BITCODE_OBJ) $$file; done + for file in $(TMPDIR)/liblib.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done cdylib: lib.rs $(BUILD_LIB) --crate-type=cdylib --emit=obj -o $(TMPDIR)/cdylib.o - $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/cdylib.o + $(call ASSERT_IS_BITCODE_OBJ, $(TMPDIR)/cdylib.o) rdylib: lib.rs $(BUILD_LIB) --crate-type=dylib --emit=obj -o $(TMPDIR)/rdylib.o - $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/rdylib.o + $(call ASSERT_IS_BITCODE_OBJ, $(TMPDIR)/rdylib.o) exe: lib.rs $(BUILD_EXE) -o $(TMPDIR)/exe.o - $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/exe.o + $(call ASSERT_IS_BITCODE_OBJ, $(TMPDIR)/exe.o) + +else + +all: + +endif diff --git a/src/test/run-pass/allocator/auxiliary/custom-as-global.rs b/src/test/run-pass/allocator/auxiliary/custom-as-global.rs index 6842e2c33b2..a5e96e77501 100644 --- a/src/test/run-pass/allocator/auxiliary/custom-as-global.rs +++ b/src/test/run-pass/allocator/auxiliary/custom-as-global.rs @@ -4,12 +4,12 @@ extern crate custom; -use std::sync::atomic::{ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use custom::A; #[global_allocator] -static ALLOCATOR: A = A(ATOMIC_USIZE_INIT); +static ALLOCATOR: A = A(AtomicUsize::new(0)); pub fn get() -> usize { ALLOCATOR.0.load(Ordering::SeqCst) diff --git a/src/test/run-pass/allocator/custom.rs b/src/test/run-pass/allocator/custom.rs index a8c6e0325e1..71f72ae46c2 100644 --- a/src/test/run-pass/allocator/custom.rs +++ b/src/test/run-pass/allocator/custom.rs @@ -8,9 +8,9 @@ extern crate helper; use std::alloc::{self, Global, Alloc, System, Layout}; -use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; +use std::sync::atomic::{AtomicUsize, Ordering}; -static HITS: AtomicUsize = ATOMIC_USIZE_INIT; +static HITS: AtomicUsize = AtomicUsize::new(0); struct A; diff --git a/src/test/run-pass/allocator/xcrate-use.rs b/src/test/run-pass/allocator/xcrate-use.rs index eb911a62e91..039c70e77be 100644 --- a/src/test/run-pass/allocator/xcrate-use.rs +++ b/src/test/run-pass/allocator/xcrate-use.rs @@ -10,10 +10,10 @@ extern crate custom; extern crate helper; use std::alloc::{Global, Alloc, System, Layout}; -use std::sync::atomic::{Ordering, ATOMIC_USIZE_INIT}; +use std::sync::atomic::{Ordering, AtomicUsize}; #[global_allocator] -static GLOBAL: custom::A = custom::A(ATOMIC_USIZE_INIT); +static GLOBAL: custom::A = custom::A(AtomicUsize::new(0)); fn main() { unsafe { diff --git a/src/test/run-pass/allocator/xcrate-use2.rs b/src/test/run-pass/allocator/xcrate-use2.rs index be657f127bb..d8478fb5eaa 100644 --- a/src/test/run-pass/allocator/xcrate-use2.rs +++ b/src/test/run-pass/allocator/xcrate-use2.rs @@ -12,9 +12,9 @@ extern crate custom_as_global; extern crate helper; use std::alloc::{alloc, dealloc, GlobalAlloc, System, Layout}; -use std::sync::atomic::{Ordering, ATOMIC_USIZE_INIT}; +use std::sync::atomic::{AtomicUsize, Ordering}; -static GLOBAL: custom::A = custom::A(ATOMIC_USIZE_INIT); +static GLOBAL: custom::A = custom::A(AtomicUsize::new(0)); fn main() { unsafe { @@ -45,4 +45,3 @@ fn main() { assert_eq!(GLOBAL.0.load(Ordering::SeqCst), 2); } } - diff --git a/src/test/run-pass/atomic-access-bool.rs b/src/test/run-pass/atomic-access-bool.rs index 4f804bcdef2..8522493232f 100644 --- a/src/test/run-pass/atomic-access-bool.rs +++ b/src/test/run-pass/atomic-access-bool.rs @@ -1,9 +1,9 @@ #![allow(stable_features)] #![feature(atomic_access)] -use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT}; +use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering::*; -static mut ATOMIC: AtomicBool = ATOMIC_BOOL_INIT; +static mut ATOMIC: AtomicBool = AtomicBool::new(false); fn main() { unsafe { diff --git a/src/test/run-pass/atomic-compare_exchange.rs b/src/test/run-pass/atomic-compare_exchange.rs index c7b80c42c1b..77da820e07c 100644 --- a/src/test/run-pass/atomic-compare_exchange.rs +++ b/src/test/run-pass/atomic-compare_exchange.rs @@ -1,10 +1,10 @@ #![allow(stable_features)] #![feature(extended_compare_and_swap)] -use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT}; +use std::sync::atomic::AtomicIsize; use std::sync::atomic::Ordering::*; -static ATOMIC: AtomicIsize = ATOMIC_ISIZE_INIT; +static ATOMIC: AtomicIsize = AtomicIsize::new(0); fn main() { // Make sure codegen can emit all the intrinsics correctly diff --git a/src/test/run-pass/deriving/deriving-copyclone.rs b/src/test/run-pass/deriving/deriving-copyclone.rs index cdeb5d03d35..78d74a11ffc 100644 --- a/src/test/run-pass/deriving/deriving-copyclone.rs +++ b/src/test/run-pass/deriving/deriving-copyclone.rs @@ -2,7 +2,7 @@ //! Test that #[derive(Copy, Clone)] produces a shallow copy //! even when a member violates RFC 1521 -use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; +use std::sync::atomic::{AtomicBool, Ordering}; /// A struct that pretends to be Copy, but actually does something /// in its Clone impl @@ -10,7 +10,7 @@ use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; struct Liar; /// Static cooperating with the rogue Clone impl -static CLONED: AtomicBool = ATOMIC_BOOL_INIT; +static CLONED: AtomicBool = AtomicBool::new(false); impl Clone for Liar { fn clone(&self) -> Self { @@ -36,4 +36,3 @@ fn main() { // if Innocent was byte-for-byte copied, CLONED will still be false assert!(!CLONED.load(Ordering::SeqCst)); } - diff --git a/src/test/run-pass/generator/conditional-drop.rs b/src/test/run-pass/generator/conditional-drop.rs index b7d7681d25c..766eef9e3f3 100644 --- a/src/test/run-pass/generator/conditional-drop.rs +++ b/src/test/run-pass/generator/conditional-drop.rs @@ -3,9 +3,9 @@ #![feature(generators, generator_trait)] use std::ops::Generator; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; -static A: AtomicUsize = ATOMIC_USIZE_INIT; +static A: AtomicUsize = AtomicUsize::new(0); struct B; diff --git a/src/test/run-pass/generator/drop-env.rs b/src/test/run-pass/generator/drop-env.rs index bd988897710..252f2c0f07d 100644 --- a/src/test/run-pass/generator/drop-env.rs +++ b/src/test/run-pass/generator/drop-env.rs @@ -3,9 +3,9 @@ #![feature(generators, generator_trait)] use std::ops::Generator; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; -static A: AtomicUsize = ATOMIC_USIZE_INIT; +static A: AtomicUsize = AtomicUsize::new(0); struct B; diff --git a/src/test/run-pass/generator/panic-drops.rs b/src/test/run-pass/generator/panic-drops.rs index ce12f4225ef..8640a653919 100644 --- a/src/test/run-pass/generator/panic-drops.rs +++ b/src/test/run-pass/generator/panic-drops.rs @@ -6,9 +6,9 @@ use std::ops::Generator; use std::panic; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; -static A: AtomicUsize = ATOMIC_USIZE_INIT; +static A: AtomicUsize = AtomicUsize::new(0); struct B; diff --git a/src/test/run-pass/issues/issue-34053.rs b/src/test/run-pass/issues/issue-34053.rs index ec5a0cbf6bb..fa23ae8f95b 100644 --- a/src/test/run-pass/issues/issue-34053.rs +++ b/src/test/run-pass/issues/issue-34053.rs @@ -1,7 +1,7 @@ // run-pass -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; -static DROP_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT; +static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0); struct A(i32); diff --git a/src/test/run-pass/mir/mir_fat_ptr_drop.rs b/src/test/run-pass/mir/mir_fat_ptr_drop.rs index 9f4f3d6c5d3..d865c3499b2 100644 --- a/src/test/run-pass/mir/mir_fat_ptr_drop.rs +++ b/src/test/run-pass/mir/mir_fat_ptr_drop.rs @@ -10,7 +10,7 @@ use std::sync::atomic; use std::sync::atomic::Ordering::SeqCst; -static COUNTER: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; +static COUNTER: atomic::AtomicUsize = atomic::AtomicUsize::new(0); struct DropMe { } diff --git a/src/test/run-pass/panics/panic-recover-propagate.rs b/src/test/run-pass/panics/panic-recover-propagate.rs index 0a15417f72a..7969336ca74 100644 --- a/src/test/run-pass/panics/panic-recover-propagate.rs +++ b/src/test/run-pass/panics/panic-recover-propagate.rs @@ -1,11 +1,11 @@ // run-pass // ignore-emscripten no threads support -use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::panic; use std::thread; -static A: AtomicUsize = ATOMIC_USIZE_INIT; +static A: AtomicUsize = AtomicUsize::new(0); fn main() { panic::set_hook(Box::new(|_| { diff --git a/src/test/run-pass/threads-sendsync/tls-init-on-init.rs b/src/test/run-pass/threads-sendsync/tls-init-on-init.rs index 6ac7a9253cd..193c1815105 100644 --- a/src/test/run-pass/threads-sendsync/tls-init-on-init.rs +++ b/src/test/run-pass/threads-sendsync/tls-init-on-init.rs @@ -6,13 +6,13 @@ #![feature(thread_local_try_with)] use std::thread; -use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; +use std::sync::atomic::{AtomicUsize, Ordering}; struct Foo { cnt: usize } thread_local!(static FOO: Foo = Foo::init()); -static CNT: AtomicUsize = ATOMIC_USIZE_INIT; +static CNT: AtomicUsize = AtomicUsize::new(0); impl Foo { fn init() -> Foo { diff --git a/src/test/ui/borrowck/issue-47215-ice-from-drop-elab.rs b/src/test/ui/borrowck/issue-47215-ice-from-drop-elab.rs index 670c6bb869d..7477947b89c 100644 --- a/src/test/ui/borrowck/issue-47215-ice-from-drop-elab.rs +++ b/src/test/ui/borrowck/issue-47215-ice-from-drop-elab.rs @@ -10,7 +10,7 @@ #![feature(thread_local)] #[thread_local] -static mut X: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::ATOMIC_USIZE_INIT; +static mut X: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0); fn main() { unsafe { diff --git a/src/test/ui/error-codes/E0492.rs b/src/test/ui/error-codes/E0492.rs index b1824941adf..2de4c12eb64 100644 --- a/src/test/ui/error-codes/E0492.rs +++ b/src/test/ui/error-codes/E0492.rs @@ -1,6 +1,6 @@ -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT}; +use std::sync::atomic::AtomicUsize; -const A: AtomicUsize = ATOMIC_USIZE_INIT; +const A: AtomicUsize = AtomicUsize::new(0); static B: &'static AtomicUsize = &A; //~ ERROR E0492 fn main() { diff --git a/src/tools/cargo b/src/tools/cargo index 907c0febe70..24581807605 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 907c0febe7045fa02dff2a35c5e36d3bd59ea50d +Subproject commit 245818076052dd7178f5bb7585f5aec5b6c1e03e diff --git a/src/tools/remote-test-server/src/main.rs b/src/tools/remote-test-server/src/main.rs index 74dde8bf0e2..3f56d4da6a3 100644 --- a/src/tools/remote-test-server/src/main.rs +++ b/src/tools/remote-test-server/src/main.rs @@ -20,7 +20,7 @@ use std::os::unix::prelude::*; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::str; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; use std::thread; @@ -31,7 +31,7 @@ macro_rules! t { }) } -static TEST: AtomicUsize = ATOMIC_USIZE_INIT; +static TEST: AtomicUsize = AtomicUsize::new(0); struct Config { pub remote: bool, diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index 16f2e3ba27d..7126c0c2f6e 100644 --- a/src/tools/tidy/src/features.rs +++ b/src/tools/tidy/src/features.rs @@ -188,7 +188,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features { } let mut parts = line.split(','); - let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) { + let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) { Some("active") => Status::Unstable, Some("removed") => Status::Removed, Some("accepted") => Status::Stable,