From d3c6665e0dbb874b61184032ab84718c6c80d1a5 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 19 Jan 2019 16:25:06 -0700 Subject: [PATCH] Bump bootstrap compiler to 1.33 beta --- src/bootstrap/channel.rs | 2 +- src/bootstrap/dist.rs | 2 +- src/bootstrap/lib.rs | 2 +- src/liballoc/benches/vec_deque_append.rs | 1 - src/libcore/intrinsics.rs | 1 - src/libcore/lib.rs | 7 +- src/libcore/mem.rs | 4 - src/libcore/num/bignum.rs | 11 -- src/libcore/num/mod.rs | 134 +---------------------- src/libcore/ops/deref.rs | 2 +- src/libpanic_abort/lib.rs | 1 - src/librustc_mir/lib.rs | 2 - src/libstd/lib.rs | 3 - src/libstd/net/ip.rs | 1 - src/libtest/lib.rs | 1 - src/libunwind/lib.rs | 1 - src/stage0.txt | 2 +- src/tools/linkchecker/main.rs | 6 +- src/tools/tidy/src/features.rs | 2 +- 19 files changed, 16 insertions(+), 169 deletions(-) diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index 63741b9b677b4..0b2f62485c9ee 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/dist.rs b/src/bootstrap/dist.rs index df34dfe4544ae..0c6e21311093e 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 bddc6362389ad..7491385af7929 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/liballoc/benches/vec_deque_append.rs b/src/liballoc/benches/vec_deque_append.rs index 2db8fbe130907..78ec91d9e3e9b 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/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index db19baf7a2c64..e66a846537043 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 33c0da8a54049..ec5fd42a86bdb 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)] @@ -111,19 +110,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 8fcbb73d9ce46..7e43f4cbae7c8 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -492,7 +492,6 @@ pub const fn needs_drop() -> bool { #[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::zeroed` instead")] #[stable(feature = "rust1", since = "1.0.0")] pub unsafe fn zeroed() -> T { - #[cfg(not(stage0))] intrinsics::panic_if_uninhabited::(); intrinsics::init() } @@ -626,8 +625,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() } @@ -1132,7 +1129,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 5326ef1e7c12e..c3a42a0fc0494 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 6827364c0f805..7111b41a635dc 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -275,7 +275,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() } } @@ -291,7 +290,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() @@ -312,7 +310,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() @@ -333,7 +330,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() @@ -357,7 +353,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 @@ -382,7 +377,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 @@ -404,7 +398,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 @@ -454,7 +447,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")] @@ -488,7 +480,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")] @@ -522,7 +513,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")] @@ -556,7 +546,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")] @@ -994,14 +983,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) } } @@ -1021,14 +1004,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) } } @@ -1047,14 +1024,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) } } @@ -1214,7 +1185,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 { @@ -1242,7 +1212,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 { @@ -1340,14 +1309,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) } @@ -1371,14 +1334,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) } @@ -1400,14 +1357,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) } @@ -1591,7 +1542,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))) @@ -1615,7 +1565,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))) @@ -2240,13 +2189,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 } } @@ -2261,7 +2206,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() @@ -2281,13 +2225,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 } } @@ -2305,13 +2245,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 } } @@ -2332,12 +2268,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) } } @@ -2360,12 +2292,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) } } @@ -2385,13 +2313,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 } } @@ -2411,13 +2335,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 } } @@ -2441,7 +2361,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")] @@ -2475,7 +2394,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")] @@ -2509,7 +2427,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")] @@ -2543,7 +2460,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 { @@ -3219,14 +3115,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) } @@ -3251,14 +3141,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) } @@ -3282,14 +3166,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) } @@ -3448,7 +3326,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))) @@ -3473,7 +3350,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 075c3a084f41d..42bb5cabb48cd 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/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs index 8832a16d4ca4e..f6306d23c30c0 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_mir/lib.rs b/src/librustc_mir/lib.rs index 9395da60b3886..ccfc15bac042c 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/libstd/lib.rs b/src/libstd/lib.rs index 83db3f347a761..d1a6f47dffbba 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -238,12 +238,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 f98113e0896f7..f45cd8b8c101a 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/libtest/lib.rs b/src/libtest/lib.rs index 2cc80ddea2df4..7547814129d6c 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))] #![feature(nll)] diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 7ed7837268dcd..5f9c82431b786 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 2e376ed1cede5..36d30b7d27342 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/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 59662be349dcb..2cf0fcfd34cd6 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -78,7 +78,7 @@ impl FileEntry { fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) { if self.ids.is_empty() { with_attrs_in_source(contents, " id", |fragment, i, _| { - let frag = fragment.trim_left_matches("#").to_owned(); + let frag = fragment.trim_start_matches("#").to_owned(); let encoded = small_url_encode(&frag); if !self.ids.insert(frag) { *errors = true; @@ -343,7 +343,7 @@ fn with_attrs_in_source(contents: &str, attr: &str, Some(i) => i, None => continue, }; - if rest[..pos_equals].trim_left_matches(" ") != "" { + if rest[..pos_equals].trim_start_matches(" ") != "" { continue; } @@ -355,7 +355,7 @@ fn with_attrs_in_source(contents: &str, attr: &str, }; let quote_delim = rest.as_bytes()[pos_quote] as char; - if rest[..pos_quote].trim_left_matches(" ") != "" { + if rest[..pos_quote].trim_start_matches(" ") != "" { continue; } let rest = &rest[pos_quote + 1..]; diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index 16f2e3ba27dbb..7126c0c2f6ecf 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,