diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index b17ee098ff62a..ec4bf9a04fa94 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -13,7 +13,7 @@ use build_helper::output; use crate::Build; // The version number -pub const CFG_RELEASE_NUM: &str = "1.41.0"; +pub const CFG_RELEASE_NUM: &str = "1.42.0"; pub struct GitInfo { inner: Option, diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs index 4a74a479e71bb..5a6d4ee2aea93 100644 --- a/src/liballoc/collections/linked_list.rs +++ b/src/liballoc/collections/linked_list.rs @@ -275,10 +275,7 @@ impl LinkedList { /// let list: LinkedList = LinkedList::new(); /// ``` #[inline] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_linked_list_new", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_linked_list_new", since = "1.32.0")] #[stable(feature = "rust1", since = "1.0.0")] pub const fn new() -> Self { LinkedList { diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index d828e374a7b22..0137275bc1589 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -116,8 +116,6 @@ #![feature(unsize)] #![feature(unsized_locals)] #![feature(allocator_internals)] -#![cfg_attr(bootstrap, feature(on_unimplemented))] -#![cfg_attr(bootstrap, feature(rustc_const_unstable))] #![feature(slice_partition_dedup)] #![feature(maybe_uninit_extra, maybe_uninit_slice)] #![feature(alloc_layout_extra)] diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index bf9bbba47535d..f880f5915a36a 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -367,10 +367,7 @@ impl String { /// let s = String::new(); /// ``` #[inline] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_string_new", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_string_new", since = "1.32.0")] #[stable(feature = "rust1", since = "1.0.0")] pub const fn new() -> String { String { vec: Vec::new() } diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 2ad4e22884ea7..19c95e2079313 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -315,10 +315,7 @@ impl Vec { /// let mut vec: Vec = Vec::new(); /// ``` #[inline] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_vec_new", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_vec_new", since = "1.32.0")] #[stable(feature = "rust1", since = "1.0.0")] pub const fn new() -> Vec { Vec { diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index 71517ffb0065e..cb476acfb3a9e 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -100,7 +100,7 @@ impl Layout { /// This function is unsafe as it does not verify the preconditions from /// [`Layout::from_size_align`](#method.from_size_align). #[stable(feature = "alloc_layout", since = "1.28.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "alloc_layout", since = "1.28.0"))] + #[rustc_const_stable(feature = "alloc_layout", since = "1.28.0")] #[inline] pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self { Layout { size_: size, align_: NonZeroUsize::new_unchecked(align) } diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 7935c9b1b392d..882c4a53faf2a 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -423,14 +423,9 @@ impl TypeId { /// assert_eq!(is_string(&"cookie monster".to_string()), true); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature="const_type_id"))] - #[cfg_attr(not(bootstrap), rustc_const_unstable(feature="const_type_id", issue = "41875"))] + #[rustc_const_unstable(feature="const_type_id", issue = "41875")] pub const fn of() -> TypeId { TypeId { - #[cfg(bootstrap)] - // SAFETY: going away soon - t: unsafe { intrinsics::type_id::() }, - #[cfg(not(bootstrap))] t: intrinsics::type_id::(), } } @@ -462,8 +457,7 @@ impl TypeId { /// ); /// ``` #[stable(feature = "type_name", since = "1.38.0")] -#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_type_name"))] -#[cfg_attr(not(bootstrap), rustc_const_unstable(feature = "const_type_name", issue = "63084"))] +#[rustc_const_unstable(feature = "const_type_name", issue = "63084")] pub const fn type_name() -> &'static str { intrinsics::type_name::() } @@ -501,8 +495,7 @@ pub const fn type_name() -> &'static str { /// println!("{}", type_name_of_val(&y)); /// ``` #[unstable(feature = "type_name_of_val", issue = "66359")] -#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_type_name"))] -#[cfg_attr(not(bootstrap), rustc_const_unstable(feature = "const_type_name", issue = "63084"))] +#[rustc_const_unstable(feature = "const_type_name", issue = "63084")] pub const fn type_name_of_val(val: &T) -> &'static str { let _ = val; type_name::() diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index e4b4cd31c63af..099e5307f64c8 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -324,7 +324,7 @@ impl Cell { /// let c = Cell::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_cell_new", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_cell_new", since = "1.32.0")] #[inline] pub const fn new(value: T) -> Cell { Cell { @@ -470,7 +470,7 @@ impl Cell { /// ``` #[inline] #[stable(feature = "cell_as_ptr", since = "1.12.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_cell_as_ptr", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_cell_as_ptr", since = "1.32.0")] pub const fn as_ptr(&self) -> *mut T { self.value.get() } @@ -651,7 +651,7 @@ impl RefCell { /// let c = RefCell::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_refcell_new", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_refcell_new", since = "1.32.0")] #[inline] pub const fn new(value: T) -> RefCell { RefCell { @@ -1504,10 +1504,7 @@ impl UnsafeCell { /// let uc = UnsafeCell::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_unsafe_cell_new", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_unsafe_cell_new", since = "1.32.0")] #[inline] pub const fn new(value: T) -> UnsafeCell { UnsafeCell { value } @@ -1550,10 +1547,7 @@ impl UnsafeCell { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0")] pub const fn get(&self) -> *mut T { // We can just cast the pointer from `UnsafeCell` to `T` because of // #[repr(transparent)]. This exploits libstd's special status, there is diff --git a/src/libcore/char/methods.rs b/src/libcore/char/methods.rs index 5cfb9583a86d1..bb6d6db57d214 100644 --- a/src/libcore/char/methods.rs +++ b/src/libcore/char/methods.rs @@ -911,10 +911,7 @@ impl char { /// assert!(!non_ascii.is_ascii()); /// ``` #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.32.0")] #[inline] pub const fn is_ascii(&self) -> bool { *self as u32 <= 0x7F diff --git a/src/libcore/convert/mod.rs b/src/libcore/convert/mod.rs index e5599f1dd373b..959fd63df51c2 100644 --- a/src/libcore/convert/mod.rs +++ b/src/libcore/convert/mod.rs @@ -101,7 +101,7 @@ pub use num::FloatToInt; /// assert_eq!(vec![1, 3], filtered); /// ``` #[stable(feature = "convert_id", since = "1.33.0")] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_identity", since = "1.33.0"))] +#[rustc_const_stable(feature = "const_identity", since = "1.33.0")] #[inline] pub const fn identity(x: T) -> T { x diff --git a/src/libcore/convert/num.rs b/src/libcore/convert/num.rs index 6f5ee756f58f6..596da6f786bbd 100644 --- a/src/libcore/convert/num.rs +++ b/src/libcore/convert/num.rs @@ -13,7 +13,6 @@ mod private { /// Typically doesn’t need to be used directly. #[unstable(feature = "convert_float_to_int", issue = "67057")] pub trait FloatToInt: private::Sealed + Sized { - #[cfg(not(bootstrap))] #[unstable(feature = "float_approx_unchecked_to", issue = "67058")] #[doc(hidden)] unsafe fn approx_unchecked(self) -> Int; @@ -26,7 +25,6 @@ macro_rules! impl_float_to_int { $( #[unstable(feature = "convert_float_to_int", issue = "67057")] impl FloatToInt<$Int> for $Float { - #[cfg(not(bootstrap))] #[doc(hidden)] #[inline] unsafe fn approx_unchecked(self) -> $Int { diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 1f72b7ab0902d..b02acce2d00bb 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -939,11 +939,7 @@ extern "rust-intrinsic" { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_transmute"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_transmute", issue = "53605"), - )] + #[rustc_const_unstable(feature = "const_transmute", issue = "53605")] pub fn transmute(e: T) -> U; /// Returns `true` if the actual type given as `T` requires drop @@ -1150,7 +1146,6 @@ extern "rust-intrinsic" { /// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range /// https://github.com/rust-lang/rust/issues/10184 - #[cfg(not(bootstrap))] pub fn float_to_int_approx_unchecked(value: Float) -> Int; @@ -1361,7 +1356,6 @@ extern "rust-intrinsic" { /// Compiles to a NOP during non-Miri codegen. /// /// Perma-unstable: do not use - #[cfg(not(bootstrap))] pub fn miri_start_panic(data: *mut (dyn crate::any::Any + crate::marker::Send)) -> (); } diff --git a/src/libcore/iter/adapters/mod.rs b/src/libcore/iter/adapters/mod.rs index 39d571006e66a..019a3290f01e1 100644 --- a/src/libcore/iter/adapters/mod.rs +++ b/src/libcore/iter/adapters/mod.rs @@ -517,14 +517,6 @@ impl Iterator for StepBy where I: Iterator { // overflow handling loop { let mul = n.checked_mul(step); - #[cfg(bootstrap)] - { - // SAFETY: going away soon - if unsafe { intrinsics::likely(mul.is_some()) } { - return self.iter.nth(mul.unwrap() - 1); - } - } - #[cfg(not(bootstrap))] { if intrinsics::likely(mul.is_some()) { return self.iter.nth(mul.unwrap() - 1); diff --git a/src/libcore/iter/sources.rs b/src/libcore/iter/sources.rs index 127b778e62e68..a65d47cc2c1f0 100644 --- a/src/libcore/iter/sources.rs +++ b/src/libcore/iter/sources.rs @@ -281,7 +281,7 @@ impl Default for Empty { /// assert_eq!(None, nope.next()); /// ``` #[stable(feature = "iter_empty", since = "1.2.0")] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_iter_empty", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_iter_empty", since = "1.32.0")] pub const fn empty() -> Empty { Empty(marker::PhantomData) } diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 7fe4f7e41a8d9..a2ab85e64baa1 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -74,8 +74,8 @@ #![feature(const_fn)] #![feature(const_fn_union)] #![feature(const_generics)] -#![cfg_attr(not(bootstrap), feature(const_ptr_offset_from))] -#![cfg_attr(not(bootstrap), feature(const_type_name))] +#![feature(const_ptr_offset_from)] +#![feature(const_type_name)] #![feature(custom_inner_attributes)] #![feature(decl_macro)] #![feature(doc_cfg)] @@ -91,18 +91,16 @@ #![feature(nll)] #![feature(exhaustive_patterns)] #![feature(no_core)] -#![cfg_attr(bootstrap, feature(on_unimplemented))] #![feature(optin_builtin_traits)] #![feature(prelude_import)] #![feature(repr_simd, platform_intrinsics)] #![feature(rustc_attrs)] -#![cfg_attr(bootstrap, feature(rustc_const_unstable))] #![feature(simd_ffi)] #![feature(specialization)] #![feature(staged_api)] #![feature(std_internals)] #![feature(stmt_expr_attributes)] -#![cfg_attr(not(bootstrap), feature(track_caller))] +#![feature(track_caller)] #![feature(transparent_unions)] #![feature(unboxed_closures)] #![feature(unsized_locals)] diff --git a/src/libcore/mem/manually_drop.rs b/src/libcore/mem/manually_drop.rs index 6463668a03e3d..af4635f89f61e 100644 --- a/src/libcore/mem/manually_drop.rs +++ b/src/libcore/mem/manually_drop.rs @@ -63,10 +63,7 @@ impl ManuallyDrop { /// ManuallyDrop::new(Box::new(())); /// ``` #[stable(feature = "manually_drop", since = "1.20.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_manually_drop", since = "1.36.0"), - )] + #[rustc_const_stable(feature = "const_manually_drop", since = "1.36.0")] #[inline(always)] pub const fn new(value: T) -> ManuallyDrop { ManuallyDrop { value } @@ -84,10 +81,7 @@ impl ManuallyDrop { /// let _: Box<()> = ManuallyDrop::into_inner(x); // This drops the `Box`. /// ``` #[stable(feature = "manually_drop", since = "1.20.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_manually_drop", since = "1.36.0"), - )] + #[rustc_const_stable(feature = "const_manually_drop", since = "1.36.0")] #[inline(always)] pub const fn into_inner(slot: ManuallyDrop) -> T { slot.value diff --git a/src/libcore/mem/maybe_uninit.rs b/src/libcore/mem/maybe_uninit.rs index 670a194e2d6cc..7f80f61aaf96d 100644 --- a/src/libcore/mem/maybe_uninit.rs +++ b/src/libcore/mem/maybe_uninit.rs @@ -250,10 +250,7 @@ impl MaybeUninit { /// /// [`assume_init`]: #method.assume_init #[stable(feature = "maybe_uninit", since = "1.36.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0"), - )] + #[rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0")] #[inline(always)] pub const fn new(val: T) -> MaybeUninit { MaybeUninit { value: ManuallyDrop::new(val) } @@ -268,12 +265,9 @@ impl MaybeUninit { /// /// [type]: union.MaybeUninit.html #[stable(feature = "maybe_uninit", since = "1.36.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0"), - )] + #[rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0")] #[inline(always)] - #[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "maybe_uninit_uninit")] + #[rustc_diagnostic_item = "maybe_uninit_uninit"] pub const fn uninit() -> MaybeUninit { MaybeUninit { uninit: () } } @@ -357,7 +351,7 @@ impl MaybeUninit { /// ``` #[stable(feature = "maybe_uninit", since = "1.36.0")] #[inline] - #[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "maybe_uninit_zeroed")] + #[rustc_diagnostic_item = "maybe_uninit_zeroed"] pub fn zeroed() -> MaybeUninit { let mut u = MaybeUninit::::uninit(); unsafe { @@ -498,7 +492,7 @@ impl MaybeUninit { /// ``` #[stable(feature = "maybe_uninit", since = "1.36.0")] #[inline(always)] - #[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "assume_init")] + #[rustc_diagnostic_item = "assume_init"] pub unsafe fn assume_init(self) -> T { intrinsics::panic_if_uninhabited::(); ManuallyDrop::into_inner(self.value) diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index 00b32ad0b73f0..4e8ba8131f7a6 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -271,7 +271,7 @@ pub fn forget_unsized(t: T) { #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_size_of", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_size_of", since = "1.32.0")] pub const fn size_of() -> usize { intrinsics::size_of::() } @@ -299,10 +299,6 @@ pub const fn size_of() -> usize { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn size_of_val(val: &T) -> usize { - #[cfg(bootstrap)] - // SAFETY: going away soon - unsafe { intrinsics::size_of_val(val) } - #[cfg(not(bootstrap))] intrinsics::size_of_val(val) } @@ -347,10 +343,6 @@ pub fn min_align_of() -> usize { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(reason = "use `align_of_val` instead", since = "1.2.0")] pub fn min_align_of_val(val: &T) -> usize { - #[cfg(bootstrap)] - // SAFETY: going away soon - unsafe { intrinsics::min_align_of_val(val) } - #[cfg(not(bootstrap))] intrinsics::min_align_of_val(val) } @@ -372,7 +364,7 @@ pub fn min_align_of_val(val: &T) -> usize { #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_align_of", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_align_of", since = "1.32.0")] pub const fn align_of() -> usize { intrinsics::min_align_of::() } @@ -455,7 +447,7 @@ pub fn align_of_val(val: &T) -> usize { /// ``` #[inline] #[stable(feature = "needs_drop", since = "1.21.0")] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_needs_drop", since = "1.36.0"))] +#[rustc_const_stable(feature = "const_needs_drop", since = "1.36.0")] pub const fn needs_drop() -> bool { intrinsics::needs_drop::() } @@ -501,7 +493,7 @@ pub const fn needs_drop() -> bool { #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated_in_future)] #[allow(deprecated)] -#[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "mem_zeroed")] +#[rustc_diagnostic_item = "mem_zeroed"] pub unsafe fn zeroed() -> T { intrinsics::panic_if_uninhabited::(); intrinsics::init() @@ -534,7 +526,7 @@ pub unsafe fn zeroed() -> T { #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated_in_future)] #[allow(deprecated)] -#[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "mem_uninitialized")] +#[rustc_diagnostic_item = "mem_uninitialized"] pub unsafe fn uninitialized() -> T { intrinsics::panic_if_uninhabited::(); intrinsics::uninit() @@ -874,11 +866,5 @@ impl fmt::Debug for Discriminant { /// ``` #[stable(feature = "discriminant_value", since = "1.21.0")] pub fn discriminant(v: &T) -> Discriminant { - #[cfg(bootstrap)] - // SAFETY: going away soon - unsafe { - Discriminant(intrinsics::discriminant_value(v), PhantomData) - } - #[cfg(not(bootstrap))] Discriminant(intrinsics::discriminant_value(v), PhantomData) } diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index ac06f95e244b6..9e379e638103e 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -7,7 +7,6 @@ #![stable(feature = "rust1", since = "1.0.0")] -#[cfg(not(bootstrap))] use crate::convert::FloatToInt; #[cfg(not(test))] use crate::intrinsics; @@ -423,7 +422,6 @@ impl f32 { /// * Not be `NaN` /// * Not be infinite /// * Be representable in the return type `Int`, after truncating off its fractional part - #[cfg(not(bootstrap))] #[unstable(feature = "float_approx_unchecked_to", issue = "67058")] #[inline] pub unsafe fn approx_unchecked_to(self) -> Int where Self: FloatToInt { diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 5446ce3e3b3e9..540c6a529d7c8 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -7,7 +7,6 @@ #![stable(feature = "rust1", since = "1.0.0")] -#[cfg(not(bootstrap))] use crate::convert::FloatToInt; #[cfg(not(test))] use crate::intrinsics; @@ -436,7 +435,6 @@ impl f64 { /// * Not be `NaN` /// * Not be infinite /// * Be representable in the return type `Int`, after truncating off its fractional part - #[cfg(not(bootstrap))] #[unstable(feature = "float_approx_unchecked_to", issue = "67058")] #[inline] pub unsafe fn approx_unchecked_to(self) -> Int diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index d091a8d86ea49..6c864f74b1f14 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -61,10 +61,7 @@ assert_eq!(size_of::>(), size_of::<", s /// /// The value must not be zero. #[$stability] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "nonzero", since = "1.34.0"), - )] + #[rustc_const_stable(feature = "nonzero", since = "1.34.0")] #[inline] pub const unsafe fn new_unchecked(n: $Int) -> Self { Self(n) @@ -85,10 +82,7 @@ assert_eq!(size_of::>(), size_of::<", s /// Returns the value as a primitive type. #[$stability] #[inline] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "nonzero", since = "1.34.0"), - )] + #[rustc_const_stable(feature = "nonzero", since = "1.34.0")] pub const fn get(self) -> $Int { self.0 } @@ -264,10 +258,7 @@ $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[inline(always)] #[rustc_promotable] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_min_value", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_min_value", since = "1.32.0")] pub const fn min_value() -> Self { !0 ^ ((!0 as $UnsignedT) >> 1) as Self } @@ -287,10 +278,7 @@ $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[inline(always)] #[rustc_promotable] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_max_value", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_max_value", since = "1.32.0")] pub const fn max_value() -> Self { !Self::min_value() } @@ -340,10 +328,7 @@ $EndFeature, " ``` "), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn count_ones(self) -> u32 { (self as $UnsignedT).count_ones() } } @@ -359,10 +344,7 @@ Basic usage: ", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 1);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn count_zeros(self) -> u32 { (!self).count_ones() @@ -383,10 +365,7 @@ assert_eq!(n.leading_zeros(), 0);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn leading_zeros(self) -> u32 { (self as $UnsignedT).leading_zeros() @@ -407,10 +386,7 @@ assert_eq!(n.trailing_zeros(), 2);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn trailing_zeros(self) -> u32 { (self as $UnsignedT).trailing_zeros() @@ -434,10 +410,7 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -464,10 +437,7 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -491,10 +461,7 @@ let m = n.swap_bytes(); assert_eq!(m, ", $swapped, "); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn swap_bytes(self) -> Self { (self as $UnsignedT).swap_bytes() as Self @@ -515,10 +482,7 @@ let m = n.reverse_bits(); assert_eq!(m, ", $reversed, "); ```"), #[stable(feature = "reverse_bits", since = "1.37.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] #[must_use] pub const fn reverse_bits(self) -> Self { @@ -546,10 +510,7 @@ if cfg!(target_endian = \"big\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_conversions", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_conversions", since = "1.32.0")] #[inline] pub const fn from_be(x: Self) -> Self { #[cfg(target_endian = "big")] @@ -583,10 +544,7 @@ if cfg!(target_endian = \"little\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_conversions", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_conversions", since = "1.32.0")] #[inline] pub const fn from_le(x: Self) -> Self { #[cfg(target_endian = "little")] @@ -620,10 +578,7 @@ if cfg!(target_endian = \"big\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_conversions", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_conversions", since = "1.32.0")] #[inline] pub const fn to_be(self) -> Self { // or not to be? #[cfg(target_endian = "big")] @@ -657,10 +612,7 @@ if cfg!(target_endian = \"little\") { $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_conversions", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_conversions", since = "1.32.0")] #[inline] pub const fn to_le(self) -> Self { #[cfg(target_endian = "little")] @@ -1013,11 +965,7 @@ $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_saturating_int_methods"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1043,11 +991,7 @@ assert_eq!(", stringify!($SelfT), "::max_value().saturating_sub(-1), ", stringif $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_saturating_int_methods"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1187,10 +1131,7 @@ assert_eq!(", stringify!($SelfT), "::max_value().wrapping_add(2), ", stringify!( $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1214,10 +1155,7 @@ stringify!($SelfT), "::max_value());", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1240,10 +1178,7 @@ assert_eq!(11i8.wrapping_mul(12), -124);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1388,10 +1323,7 @@ assert_eq!(", stringify!($SelfT), "::min_value().wrapping_neg(), ", stringify!($ $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn wrapping_neg(self) -> Self { self.overflowing_neg().0 @@ -1417,10 +1349,7 @@ assert_eq!((-1", stringify!($SelfT), ").wrapping_shl(128), -1);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1452,10 +1381,7 @@ assert_eq!((-128i16).wrapping_shr(64), -128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1489,10 +1415,7 @@ assert_eq!((-128i8).wrapping_abs() as u8, 128);", $EndFeature, " ```"), #[stable(feature = "no_panic_abs", since = "1.13.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn wrapping_abs(self) -> Self { // sign is -1 (all ones) for negative numbers, 0 otherwise. @@ -1567,10 +1490,7 @@ assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($Sel "::MIN, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1598,10 +1518,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($Sel "::MAX, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1627,10 +1544,7 @@ assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1798,10 +1712,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self ```"), #[inline] #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] pub const fn overflowing_neg(self) -> (Self, bool) { ((!self).wrapping_add(1), self == Self::min_value()) } @@ -1824,10 +1735,7 @@ assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1853,10 +1761,7 @@ assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1885,10 +1790,7 @@ assert_eq!((", stringify!($SelfT), "::min_value()).overflowing_abs(), (", string $EndFeature, " ```"), #[stable(feature = "no_panic_abs", since = "1.13.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn overflowing_abs(self) -> (Self, bool) { (self.wrapping_abs(), self == Self::min_value()) @@ -2093,10 +1995,7 @@ assert_eq!((-10", stringify!($SelfT), ").abs(), 10);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] #[rustc_inherit_overflow_checks] pub const fn abs(self) -> Self { @@ -2139,11 +2038,7 @@ assert_eq!((-10", stringify!($SelfT), ").signum(), -1);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_sign"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_sign", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_sign", issue = "53718")] #[inline] pub const fn signum(self) -> Self { (self > 0) as Self - (self < 0) as Self @@ -2164,10 +2059,7 @@ assert!(!(-10", stringify!($SelfT), ").is_positive());", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn is_positive(self) -> bool { self > 0 } } @@ -2186,10 +2078,7 @@ assert!(!10", stringify!($SelfT), ".is_negative());", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_int_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] #[inline] pub const fn is_negative(self) -> bool { self < 0 } } @@ -2207,11 +2096,7 @@ let bytes = ", $swap_op, stringify!($SelfT), ".to_be_bytes(); assert_eq!(bytes, ", $be_bytes, "); ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn to_be_bytes(self) -> [u8; mem::size_of::()] { self.to_be().to_ne_bytes() @@ -2231,11 +2116,7 @@ let bytes = ", $swap_op, stringify!($SelfT), ".to_le_bytes(); assert_eq!(bytes, ", $le_bytes, "); ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn to_le_bytes(self) -> [u8; mem::size_of::()] { self.to_le().to_ne_bytes() @@ -2270,11 +2151,7 @@ assert_eq!( ); ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn to_ne_bytes(self) -> [u8; mem::size_of::()] { // SAFETY: integers are plain old datatypes so we can always transmute them to @@ -2308,11 +2185,7 @@ fn read_be_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), } ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn from_be_bytes(bytes: [u8; mem::size_of::()]) -> Self { Self::from_be(Self::from_ne_bytes(bytes)) @@ -2345,11 +2218,7 @@ fn read_le_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), } ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn from_le_bytes(bytes: [u8; mem::size_of::()]) -> Self { Self::from_le(Self::from_ne_bytes(bytes)) @@ -2392,11 +2261,7 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), } ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn from_ne_bytes(bytes: [u8; mem::size_of::()]) -> Self { // SAFETY: integers are plain old datatypes so we can always transmute to them @@ -2490,10 +2355,7 @@ Basic usage: #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] #[inline(always)] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_min_value", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_min_value", since = "1.32.0")] pub const fn min_value() -> Self { 0 } } @@ -2511,10 +2373,7 @@ stringify!($MaxV), ");", $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] #[inline(always)] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_max_value", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_max_value", since = "1.32.0")] pub const fn max_value() -> Self { !0 } } @@ -2561,10 +2420,7 @@ Basic usage: assert_eq!(n.count_ones(), 3);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn count_ones(self) -> u32 { intrinsics::ctpop(self as $ActualT) as u32 @@ -2582,10 +2438,7 @@ Basic usage: ", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 0);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn count_zeros(self) -> u32 { (!self).count_ones() @@ -2605,10 +2458,7 @@ Basic usage: assert_eq!(n.leading_zeros(), 2);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn leading_zeros(self) -> u32 { intrinsics::ctlz(self as $ActualT) as u32 @@ -2629,10 +2479,7 @@ Basic usage: assert_eq!(n.trailing_zeros(), 3);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn trailing_zeros(self) -> u32 { intrinsics::cttz(self) as u32 @@ -2656,10 +2503,7 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2686,10 +2530,7 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2713,10 +2554,7 @@ let m = n.swap_bytes(); assert_eq!(m, ", $swapped, "); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn swap_bytes(self) -> Self { intrinsics::bswap(self as $ActualT) as Self @@ -2737,10 +2575,7 @@ let m = n.reverse_bits(); assert_eq!(m, ", $reversed, "); ```"), #[stable(feature = "reverse_bits", since = "1.37.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] #[must_use] pub const fn reverse_bits(self) -> Self { @@ -2768,10 +2603,7 @@ if cfg!(target_endian = \"big\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn from_be(x: Self) -> Self { #[cfg(target_endian = "big")] @@ -2805,10 +2637,7 @@ if cfg!(target_endian = \"little\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn from_le(x: Self) -> Self { #[cfg(target_endian = "little")] @@ -2842,10 +2671,7 @@ if cfg!(target_endian = \"big\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn to_be(self) -> Self { // or not to be? #[cfg(target_endian = "big")] @@ -2879,10 +2705,7 @@ if cfg!(target_endian = \"little\") { }", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_math", since = "1.32.0")] #[inline] pub const fn to_le(self) -> Self { #[cfg(target_endian = "little")] @@ -3188,11 +3011,7 @@ assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_saturating_int_methods"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] #[inline] pub const fn saturating_add(self, rhs: Self) -> Self { intrinsics::saturating_add(self, rhs) @@ -3214,11 +3033,7 @@ assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_saturating_int_methods"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] #[inline] pub const fn saturating_sub(self, rhs: Self) -> Self { intrinsics::saturating_sub(self, rhs) @@ -3290,10 +3105,7 @@ assert_eq!(200", stringify!($SelfT), ".wrapping_add(", stringify!($SelfT), "::ma $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3316,10 +3128,7 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_sub(", stringify!($SelfT), "::ma $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3343,10 +3152,7 @@ $EndFeature, " /// assert_eq!(25u8.wrapping_mul(12), 44); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3476,10 +3282,7 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_rem_euclid(10), 0); /// assert_eq!((-128i8).wrapping_neg(), -128); /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[inline] pub const fn wrapping_neg(self) -> Self { self.overflowing_neg().0 @@ -3506,10 +3309,7 @@ Basic usage: assert_eq!(1", stringify!($SelfT), ".wrapping_shl(128), 1);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3543,10 +3343,7 @@ Basic usage: assert_eq!(128", stringify!($SelfT), ".wrapping_shr(128), 128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3616,10 +3413,7 @@ 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( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3648,10 +3442,7 @@ assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT), $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3679,10 +3470,7 @@ $EndFeature, " /// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true)); /// ``` #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3828,10 +3616,7 @@ assert_eq!(2", stringify!($SelfT), ".overflowing_neg(), (-2i32 as ", stringify!( ```"), #[inline] #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] pub const fn overflowing_neg(self) -> (Self, bool) { ((!self).wrapping_add(1), self != 0) } @@ -3855,10 +3640,7 @@ Basic usage assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(132), (0x10, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -3885,10 +3667,7 @@ Basic usage assert_eq!(0x10", stringify!($SelfT), ".overflowing_shr(132), (0x1, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -4054,10 +3833,7 @@ Basic usage: assert!(!10", stringify!($SelfT), ".is_power_of_two());", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_is_power_of_two", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_is_power_of_two", since = "1.32.0")] #[inline] pub const fn is_power_of_two(self) -> bool { self.count_ones() == 1 @@ -4169,11 +3945,7 @@ let bytes = ", $swap_op, stringify!($SelfT), ".to_be_bytes(); assert_eq!(bytes, ", $be_bytes, "); ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn to_be_bytes(self) -> [u8; mem::size_of::()] { self.to_be().to_ne_bytes() @@ -4193,11 +3965,7 @@ let bytes = ", $swap_op, stringify!($SelfT), ".to_le_bytes(); assert_eq!(bytes, ", $le_bytes, "); ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn to_le_bytes(self) -> [u8; mem::size_of::()] { self.to_le().to_ne_bytes() @@ -4232,11 +4000,7 @@ assert_eq!( ); ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn to_ne_bytes(self) -> [u8; mem::size_of::()] { // SAFETY: integers are plain old datatypes so we can always transmute them to @@ -4270,11 +4034,7 @@ fn read_be_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), } ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn from_be_bytes(bytes: [u8; mem::size_of::()]) -> Self { Self::from_be(Self::from_ne_bytes(bytes)) @@ -4307,11 +4067,7 @@ fn read_le_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), } ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn from_le_bytes(bytes: [u8; mem::size_of::()]) -> Self { Self::from_le(Self::from_ne_bytes(bytes)) @@ -4354,11 +4110,7 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), } ```"), #[stable(feature = "int_to_from_bytes", since = "1.32.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_int_conversion"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_int_conversion", issue = "53718"), - )] + #[rustc_const_unstable(feature = "const_int_conversion", issue = "53718")] #[inline] pub const fn from_ne_bytes(bytes: [u8; mem::size_of::()]) -> Self { // SAFETY: integers are plain old datatypes so we can always transmute to them diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index 46398dd2f82ed..82fa6acfbd62a 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -530,10 +530,7 @@ assert_eq!(n.trailing_zeros(), 3); /// assert_eq!(m, Wrapping(-22016)); /// ``` #[stable(feature = "reverse_bits", since = "1.37.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_reverse_bits", since = "1.37.0"), - )] + #[rustc_const_stable(feature = "const_reverse_bits", since = "1.37.0")] #[inline] #[must_use] pub const fn reverse_bits(self) -> Self { diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs index 54ce2917a368a..be6d8edb99f59 100644 --- a/src/libcore/ops/range.rs +++ b/src/libcore/ops/range.rs @@ -398,7 +398,7 @@ impl RangeInclusive { #[stable(feature = "inclusive_range_methods", since = "1.27.0")] #[inline] #[rustc_promotable] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_range_new", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_range_new", since = "1.32.0")] pub const fn new(start: Idx, end: Idx) -> Self { Self { start, end, is_empty: None } } @@ -422,10 +422,7 @@ impl RangeInclusive { /// assert_eq!((3..=5).start(), &3); /// ``` #[stable(feature = "inclusive_range_methods", since = "1.27.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_inclusive_range_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_inclusive_range_methods", since = "1.32.0")] #[inline] pub const fn start(&self) -> &Idx { &self.start @@ -450,10 +447,7 @@ impl RangeInclusive { /// assert_eq!((3..=5).end(), &5); /// ``` #[stable(feature = "inclusive_range_methods", since = "1.27.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_inclusive_range_methods", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_inclusive_range_methods", since = "1.32.0")] #[inline] pub const fn end(&self) -> &Idx { &self.end diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs index 22ba97b91df12..996a01d413cbc 100644 --- a/src/libcore/ops/try.rs +++ b/src/libcore/ops/try.rs @@ -5,26 +5,23 @@ /// extracting those success or failure values from an existing instance and /// creating a new instance from a success or failure value. #[unstable(feature = "try_trait", issue = "42327")] -#[cfg_attr( - not(bootstrap), - rustc_on_unimplemented( - on( - all( - any(from_method = "from_error", from_method = "from_ok"), - from_desugaring = "QuestionMark" - ), - message = "the `?` operator can only be used in {ItemContext} \ - that returns `Result` or `Option` \ - (or another type that implements `{Try}`)", - label = "cannot use the `?` operator in {ItemContext} that returns `{Self}`", - enclosing_scope = "this function should return `Result` or `Option` to accept `?`" +#[rustc_on_unimplemented( + on( + all( + any(from_method = "from_error", from_method = "from_ok"), + from_desugaring = "QuestionMark" ), - on( - all(from_method = "into_result", from_desugaring = "QuestionMark"), - message = "the `?` operator can only be applied to values \ - that implement `{Try}`", - label = "the `?` operator cannot be applied to type `{Self}`" - ) + message = "the `?` operator can only be used in {ItemContext} \ + that returns `Result` or `Option` \ + (or another type that implements `{Try}`)", + label = "cannot use the `?` operator in {ItemContext} that returns `{Self}`", + enclosing_scope = "this function should return `Result` or `Option` to accept `?`" + ), + on( + all(from_method = "into_result", from_desugaring = "QuestionMark"), + message = "the `?` operator can only be applied to values \ + that implement `{Try}`", + label = "the `?` operator cannot be applied to type `{Self}`" ) )] #[doc(alias = "?")] diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index 48bb504a73c34..c9a1c4b004949 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -222,7 +222,6 @@ impl<'a> Location<'a> { /// assert_ne!(this_location.line(), another_location.line()); /// assert_ne!(this_location.column(), another_location.column()); /// ``` - #[cfg(not(bootstrap))] #[unstable(feature = "track_caller", reason = "uses #[track_caller] which is not yet stable", issue = "47809")] diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 33c23233fd1c2..776165e7bd70c 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -198,7 +198,7 @@ unsafe fn real_drop_in_place(to_drop: &mut T) { #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_null", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_ptr_null", since = "1.32.0")] pub const fn null() -> *const T { 0 as *const T } @@ -216,7 +216,7 @@ pub const fn null() -> *const T { #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_null", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_ptr_null", since = "1.32.0")] pub const fn null_mut() -> *mut T { 0 as *mut T } @@ -1062,7 +1062,7 @@ impl *const T { /// Casts to a pointer of another type. #[stable(feature = "ptr_cast", since = "1.38.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0"))] + #[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")] #[inline] pub const fn cast(self) -> *const U { self as _ @@ -1310,11 +1310,7 @@ impl *const T { /// } /// ``` #[unstable(feature = "ptr_offset_from", issue = "41079")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_ptr_offset_from"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079"), - )] + #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")] #[inline] pub const unsafe fn offset_from(self, origin: *const T) -> isize where @@ -1770,7 +1766,7 @@ impl *mut T { /// Casts to a pointer of another type. #[stable(feature = "ptr_cast", since = "1.38.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0"))] + #[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")] #[inline] pub const fn cast(self) -> *mut U { self as _ @@ -2057,11 +2053,7 @@ impl *mut T { /// } /// ``` #[unstable(feature = "ptr_offset_from", issue = "41079")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_ptr_offset_from"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079"), - )] + #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")] #[inline] pub const unsafe fn offset_from(self, origin: *const T) -> isize where diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs index d1d97d7b332fa..6946fd2413eb3 100644 --- a/src/libcore/ptr/non_null.rs +++ b/src/libcore/ptr/non_null.rs @@ -66,10 +66,7 @@ impl NonNull { /// sentinel value. Types that lazily allocate must track initialization by /// some other means. #[stable(feature = "nonnull", since = "1.25.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0")] #[inline] pub const fn dangling() -> Self { unsafe { @@ -86,10 +83,7 @@ impl NonNull { /// /// `ptr` must be non-null. #[stable(feature = "nonnull", since = "1.25.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_new_unchecked", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_new_unchecked", since = "1.32.0")] #[inline] pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { NonNull { pointer: ptr as _ } @@ -104,10 +98,7 @@ impl NonNull { /// Acquires the underlying `*mut` pointer. #[stable(feature = "nonnull", since = "1.25.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_as_ptr", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_as_ptr", since = "1.32.0")] #[inline] pub const fn as_ptr(self) -> *mut T { self.pointer as *mut T @@ -137,10 +128,7 @@ impl NonNull { /// Casts to a pointer of another type. #[stable(feature = "nonnull_cast", since = "1.27.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0")] #[inline] pub const fn cast(self) -> NonNull { unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index a8e500d256fdc..05baa1899b3e0 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -62,7 +62,7 @@ impl [T] { /// assert_eq!(a.len(), 3); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_slice_len", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_slice_len", since = "1.32.0")] #[inline] // SAFETY: const sound because we transmute out the length field as a usize (which it must be) #[allow(unused_attributes)] @@ -82,10 +82,7 @@ impl [T] { /// assert!(!a.is_empty()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_slice_is_empty", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_slice_is_empty", since = "1.32.0")] #[inline] pub const fn is_empty(&self) -> bool { self.len() == 0 @@ -381,10 +378,7 @@ impl [T] { /// /// [`as_mut_ptr`]: #method.as_mut_ptr #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_slice_as_ptr", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_slice_as_ptr", since = "1.32.0")] #[inline] pub const fn as_ptr(&self) -> *const T { self as *const [T] as *const T diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 763714e536edc..3da992dca30ee 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -2090,7 +2090,7 @@ impl str { /// assert_eq!("ƒoo".chars().count(), 3); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_str_len", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_str_len", since = "1.32.0")] #[inline] pub const fn len(&self) -> usize { self.as_bytes().len() @@ -2111,10 +2111,7 @@ impl str { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_str_is_empty", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_str_is_empty", since = "1.32.0")] pub const fn is_empty(&self) -> bool { self.len() == 0 } @@ -2171,7 +2168,7 @@ impl str { /// assert_eq!(b"bors", bytes); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "str_as_bytes", since = "1.32.0"))] + #[rustc_const_stable(feature = "str_as_bytes", since = "1.32.0")] #[inline(always)] // SAFETY: const sound because we transmute two types with the same layout #[allow(unused_attributes)] @@ -2245,7 +2242,7 @@ impl str { /// let ptr = s.as_ptr(); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "rustc_str_as_ptr", since = "1.32.0"))] + #[rustc_const_stable(feature = "rustc_str_as_ptr", since = "1.32.0")] #[inline] pub const fn as_ptr(&self) -> *const u8 { self as *const str as *const u8 diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index d5b0bc420382f..1f09895597a87 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -331,7 +331,7 @@ impl AtomicBool { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_atomic_new", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_atomic_new", since = "1.32.0")] pub const fn new(v: bool) -> AtomicBool { AtomicBool { v: UnsafeCell::new(v as u8) } } @@ -856,7 +856,7 @@ impl AtomicPtr { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_atomic_new", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_atomic_new", since = "1.32.0")] pub const fn new(p: *mut T) -> AtomicPtr { AtomicPtr { p: UnsafeCell::new(p) } } @@ -1261,7 +1261,7 @@ let atomic_forty_two = ", stringify!($atomic_type), "::new(42); ```"), #[inline] #[$stable] - #[cfg_attr(not(bootstrap), $const_stable)] + #[$const_stable] pub const fn new(v: $int_type) -> Self { Self {v: UnsafeCell::new(v)} } diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index c1e45f189b7a6..b070b665b4d09 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -39,7 +39,7 @@ impl RawWaker { /// function in the `vtable` of the underlying `RawWaker` will be called. #[rustc_promotable] #[stable(feature = "futures_api", since = "1.36.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "futures_api", since = "1.36.0"))] + #[rustc_const_stable(feature = "futures_api", since = "1.36.0")] pub const fn new(data: *const (), vtable: &'static RawWakerVTable) -> RawWaker { RawWaker { data, vtable } } @@ -152,7 +152,7 @@ impl RawWakerVTable { // FIXME: remove whenever we have a stable way to accept fn pointers from const fn // (see https://github.com/rust-rfcs/const-eval/issues/19#issuecomment-472799062) #[rustc_allow_const_fn_ptr] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "futures_api", since = "1.36.0"))] + #[rustc_const_stable(feature = "futures_api", since = "1.36.0")] pub const fn new( clone: unsafe fn(*const ()) -> RawWaker, wake: unsafe fn(*const ()), diff --git a/src/libcore/time.rs b/src/libcore/time.rs index 7d04cfb5da518..c1d405239f96f 100644 --- a/src/libcore/time.rs +++ b/src/libcore/time.rs @@ -130,7 +130,7 @@ impl Duration { /// ``` #[stable(feature = "duration", since = "1.3.0")] #[inline] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_consts", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] pub fn new(secs: u64, nanos: u32) -> Duration { let secs = secs.checked_add((nanos / NANOS_PER_SEC) as u64).expect("overflow in Duration::new"); @@ -153,7 +153,7 @@ impl Duration { #[stable(feature = "duration", since = "1.3.0")] #[inline] #[rustc_promotable] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_consts", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] pub const fn from_secs(secs: u64) -> Duration { Duration { secs, nanos: 0 } } @@ -173,7 +173,7 @@ impl Duration { #[stable(feature = "duration", since = "1.3.0")] #[inline] #[rustc_promotable] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_consts", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] pub const fn from_millis(millis: u64) -> Duration { Duration { secs: millis / MILLIS_PER_SEC, @@ -196,7 +196,7 @@ impl Duration { #[stable(feature = "duration_from_micros", since = "1.27.0")] #[inline] #[rustc_promotable] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_consts", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] pub const fn from_micros(micros: u64) -> Duration { Duration { secs: micros / MICROS_PER_SEC, @@ -219,7 +219,7 @@ impl Duration { #[stable(feature = "duration_extras", since = "1.27.0")] #[inline] #[rustc_promotable] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_consts", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_consts", since = "1.32.0")] pub const fn from_nanos(nanos: u64) -> Duration { Duration { secs: nanos / (NANOS_PER_SEC as u64), @@ -256,7 +256,7 @@ impl Duration { /// /// [`subsec_nanos`]: #method.subsec_nanos #[stable(feature = "duration", since = "1.3.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration", since = "1.32.0")] #[inline] pub const fn as_secs(&self) -> u64 { self.secs @@ -278,7 +278,7 @@ impl Duration { /// assert_eq!(duration.subsec_millis(), 432); /// ``` #[stable(feature = "duration_extras", since = "1.27.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_extras", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_extras", since = "1.32.0")] #[inline] pub const fn subsec_millis(&self) -> u32 { self.nanos / NANOS_PER_MILLI @@ -300,7 +300,7 @@ impl Duration { /// assert_eq!(duration.subsec_micros(), 234_567); /// ``` #[stable(feature = "duration_extras", since = "1.27.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_extras", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration_extras", since = "1.32.0")] #[inline] pub const fn subsec_micros(&self) -> u32 { self.nanos / NANOS_PER_MICRO @@ -322,7 +322,7 @@ impl Duration { /// assert_eq!(duration.subsec_nanos(), 10_000_000); /// ``` #[stable(feature = "duration", since = "1.3.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration", since = "1.32.0"))] + #[rustc_const_stable(feature = "duration", since = "1.32.0")] #[inline] pub const fn subsec_nanos(&self) -> u32 { self.nanos @@ -339,7 +339,7 @@ impl Duration { /// assert_eq!(duration.as_millis(), 5730); /// ``` #[stable(feature = "duration_as_u128", since = "1.33.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_as_u128", since = "1.33.0"))] + #[rustc_const_stable(feature = "duration_as_u128", since = "1.33.0")] #[inline] pub const fn as_millis(&self) -> u128 { self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128 @@ -356,7 +356,7 @@ impl Duration { /// assert_eq!(duration.as_micros(), 5730023); /// ``` #[stable(feature = "duration_as_u128", since = "1.33.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_as_u128", since = "1.33.0"))] + #[rustc_const_stable(feature = "duration_as_u128", since = "1.33.0")] #[inline] pub const fn as_micros(&self) -> u128 { self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128 @@ -373,7 +373,7 @@ impl Duration { /// assert_eq!(duration.as_nanos(), 5730023852); /// ``` #[stable(feature = "duration_as_u128", since = "1.33.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "duration_as_u128", since = "1.33.0"))] + #[rustc_const_stable(feature = "duration_as_u128", since = "1.33.0")] #[inline] pub const fn as_nanos(&self) -> u128 { self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128 diff --git a/src/librustc/ty/codec.rs b/src/librustc/ty/codec.rs index b3ef3217ec6a0..10c6a349ec801 100644 --- a/src/librustc/ty/codec.rs +++ b/src/librustc/ty/codec.rs @@ -76,9 +76,6 @@ pub fn encode_with_shorthand(encoder: &mut E, // The shorthand encoding uses the same usize as the // discriminant, with an offset so they can't conflict. - #[cfg(bootstrap)] - let discriminant = unsafe { intrinsics::discriminant_value(variant) }; - #[cfg(not(bootstrap))] let discriminant = intrinsics::discriminant_value(variant); assert!(discriminant < SHORTHAND_OFFSET as u64); let shorthand = start + SHORTHAND_OFFSET; diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 14ca0423d8bc4..05008958ed2f0 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -1065,8 +1065,7 @@ impl CStr { /// ``` #[inline] #[stable(feature = "cstr_from_bytes", since = "1.10.0")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_cstr_unchecked"))] - #[cfg_attr(not(bootstrap), rustc_const_unstable(feature = "const_cstr_unchecked", issue = "0"))] + #[rustc_const_unstable(feature = "const_cstr_unchecked", issue = "0")] pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { &*(bytes as *const [u8] as *const CStr) } @@ -1120,7 +1119,7 @@ impl CStr { /// [`CString`]: struct.CString.html #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_str_as_ptr", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_str_as_ptr", since = "1.32.0")] pub const fn as_ptr(&self) -> *const c_char { self.inner.as_ptr() } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index de33a2cb21461..340313b06dd40 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -283,7 +283,6 @@ #![feature(needs_panic_runtime)] #![feature(never_type)] #![feature(nll)] -#![cfg_attr(bootstrap, feature(on_unimplemented))] #![feature(optin_builtin_traits)] #![feature(panic_info_message)] #![feature(panic_internals)] @@ -293,7 +292,6 @@ #![feature(raw)] #![feature(renamed_spin_loop)] #![feature(rustc_attrs)] -#![cfg_attr(bootstrap, feature(rustc_const_unstable))] #![feature(rustc_private)] #![feature(shrink_to)] #![feature(slice_concat_ext)] diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index 7d69f8f4b8d2f..9e24d707f77b5 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -319,7 +319,7 @@ impl Ipv4Addr { /// let addr = Ipv4Addr::new(127, 0, 0, 1); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv4", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_ipv4", since = "1.32.0")] pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { // FIXME: should just be u32::from_be_bytes([a, b, c, d]), // once that method is no longer rustc_const_unstable @@ -407,7 +407,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false); /// ``` #[stable(feature = "ip_shared", since = "1.12.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv4", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_ipv4", since = "1.32.0")] pub const fn is_unspecified(&self) -> bool { self.inner.s_addr == 0 } @@ -1017,7 +1017,7 @@ impl Ipv6Addr { /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv6", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")] pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { Ipv6Addr { @@ -1483,7 +1483,7 @@ impl Ipv6Addr { /// [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); /// ``` #[stable(feature = "ipv6_to_octets", since = "1.12.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv6", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")] pub const fn octets(&self) -> [u8; 16] { self.inner.s6_addr } diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index d8df09071cd69..61c4d0c2dbfba 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -188,7 +188,7 @@ struct WaiterQueue<'a> { impl Once { /// Creates a new `Once` value. #[stable(feature = "once_new", since = "1.2.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_once_new", since = "1.32.0"))] + #[rustc_const_stable(feature = "const_once_new", since = "1.32.0")] pub const fn new() -> Once { Once { state_and_queue: AtomicUsize::new(INCOMPLETE), _marker: marker::PhantomData } } diff --git a/src/libsyntax_expand/expand.rs b/src/libsyntax_expand/expand.rs index 9bfedb3b6174e..dc3d5789d1b55 100644 --- a/src/libsyntax_expand/expand.rs +++ b/src/libsyntax_expand/expand.rs @@ -85,7 +85,6 @@ macro_rules! ast_fragments { $($(AstFragment::$Kind(ast) => ast.extend(placeholders.iter().flat_map(|id| { // We are repeating through arguments with `many`, to do that we have to // mention some macro variable from those arguments even if it's not used. - #[cfg_attr(bootstrap, allow(unused_macros))] macro _repeating($flat_map_ast_elt) {} placeholder(AstFragmentKind::$Kind, *id, None).$make_ast() })),)?)* diff --git a/src/stage0.txt b/src/stage0.txt index 3c84890158381..999218efa297d 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-11-06 +date: 2019-12-18 rustc: beta cargo: beta diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 15f8abd75d59a..32965bbb292da 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -569,6 +569,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { list: false, options: test::Options::new(), time_options: None, + force_run_in_process: false, } }