diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index 0324ac3641e..b63f81bffaa 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -1,5 +1,4 @@ #![feature(nll)] -#![cfg_attr(bootstrap, feature(native_link_modifiers))] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] // NOTE: This crate only exists to allow linking on mingw targets. diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs index fed6a608e57..63f2bc51aee 100644 --- a/compiler/rustc_middle/src/mir/interpret/allocation.rs +++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs @@ -58,7 +58,7 @@ pub struct Allocation { /// means that both the inner type (`Allocation`) and the outer type /// (`ConstAllocation`) are used quite a bit. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)] -#[cfg_attr(not(bootstrap), rustc_pass_by_value)] +#[rustc_pass_by_value] pub struct ConstAllocation<'tcx, Tag = AllocId, Extra = ()>( pub Interned<'tcx, Allocation>, ); diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index cb219c4c4e4..fc6710f07e3 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -161,7 +161,7 @@ impl<'a> HashStable> for AdtDefData { } #[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, HashStable)] -#[cfg_attr(not(bootstrap), rustc_pass_by_value)] +#[rustc_pass_by_value] pub struct AdtDef<'tcx>(pub Interned<'tcx, AdtDefData>); impl<'tcx> AdtDef<'tcx> { diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs index c46726b767b..169167f69bf 100644 --- a/compiler/rustc_target/src/abi/mod.rs +++ b/compiler/rustc_target/src/abi/mod.rs @@ -1262,7 +1262,7 @@ impl<'a> fmt::Debug for LayoutS<'a> { } #[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] -#[cfg_attr(not(bootstrap), rustc_pass_by_value)] +#[rustc_pass_by_value] pub struct Layout<'a>(pub Interned<'a, LayoutS<'a>>); impl<'a> fmt::Debug for Layout<'a> { diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index 44389ee47b0..39f8f1d5a0e 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -326,16 +326,12 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { #[cfg_attr(not(test), lang = "box_free")] #[inline] #[rustc_const_unstable(feature = "const_box", issue = "92521")] -#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping // This signature has to be the same as `Box`, otherwise an ICE will happen. // When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as // well. // For example if `Box` is changed to `struct Box(Unique, A)`, // this function has to be changed to `fn box_free(Unique, A)` as well. -pub(crate) const unsafe fn box_free< - T: ?Sized, - A: ~const Allocator + ~const Drop + ~const Destruct, ->( +pub(crate) const unsafe fn box_free( ptr: Unique, alloc: A, ) { diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs index 27e5af4f1be..8b13e36c4b3 100644 --- a/library/alloc/src/borrow.rs +++ b/library/alloc/src/borrow.rs @@ -331,7 +331,6 @@ impl Cow<'_, B> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_deref", issue = "88955")] -#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping impl const Deref for Cow<'_, B> where B::Owned: ~const Borrow, diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index b5f4c9a237b..a56d4de03cd 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -349,10 +349,9 @@ impl Box { #[rustc_const_unstable(feature = "const_box", issue = "92521")] #[must_use] #[inline] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn new_in(x: T, alloc: A) -> Self where - A: ~const Allocator + ~const Drop + ~const Destruct, + A: ~const Allocator + ~const Destruct, { let mut boxed = Self::new_uninit_in(alloc); unsafe { @@ -379,11 +378,10 @@ impl Box { #[unstable(feature = "allocator_api", issue = "32838")] #[rustc_const_unstable(feature = "const_box", issue = "92521")] #[inline] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn try_new_in(x: T, alloc: A) -> Result where - T: ~const Drop + ~const Destruct, - A: ~const Allocator + ~const Drop + ~const Destruct, + T: ~const Destruct, + A: ~const Allocator + ~const Destruct, { let mut boxed = Self::try_new_uninit_in(alloc)?; unsafe { @@ -417,10 +415,9 @@ impl Box { #[cfg(not(no_global_oom_handling))] #[must_use] // #[unstable(feature = "new_uninit", issue = "63291")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn new_uninit_in(alloc: A) -> Box, A> where - A: ~const Allocator + ~const Drop + ~const Destruct, + A: ~const Allocator + ~const Destruct, { let layout = Layout::new::>(); // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable. @@ -456,10 +453,9 @@ impl Box { #[unstable(feature = "allocator_api", issue = "32838")] // #[unstable(feature = "new_uninit", issue = "63291")] #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn try_new_uninit_in(alloc: A) -> Result, A>, AllocError> where - A: ~const Allocator + ~const Drop + ~const Destruct, + A: ~const Allocator + ~const Destruct, { let layout = Layout::new::>(); let ptr = alloc.allocate(layout)?.cast(); @@ -491,10 +487,9 @@ impl Box { #[cfg(not(no_global_oom_handling))] // #[unstable(feature = "new_uninit", issue = "63291")] #[must_use] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn new_zeroed_in(alloc: A) -> Box, A> where - A: ~const Allocator + ~const Drop + ~const Destruct, + A: ~const Allocator + ~const Destruct, { let layout = Layout::new::>(); // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable. @@ -530,10 +525,9 @@ impl Box { #[unstable(feature = "allocator_api", issue = "32838")] // #[unstable(feature = "new_uninit", issue = "63291")] #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> where - A: ~const Allocator + ~const Drop + ~const Destruct, + A: ~const Allocator + ~const Destruct, { let layout = Layout::new::>(); let ptr = alloc.allocate_zeroed(layout)?.cast(); @@ -547,10 +541,9 @@ impl Box { #[rustc_const_unstable(feature = "const_box", issue = "92521")] #[must_use] #[inline(always)] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn pin_in(x: T, alloc: A) -> Pin where - A: 'static + ~const Allocator + ~const Drop + ~const Destruct, + A: 'static + ~const Allocator + ~const Destruct, { Self::into_pin(Self::new_in(x, alloc)) } @@ -579,10 +572,9 @@ impl Box { #[unstable(feature = "box_into_inner", issue = "80437")] #[rustc_const_unstable(feature = "const_box", issue = "92521")] #[inline] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn into_inner(boxed: Self) -> T where - Self: ~const Drop + ~const Destruct, + Self: ~const Destruct, { *boxed } diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 065d071a2e3..72d6c267290 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -141,7 +141,6 @@ #![feature(box_syntax)] #![feature(cfg_sanitize)] #![feature(const_deref)] -#![cfg_attr(bootstrap, feature(const_fn_trait_bound))] #![feature(const_mut_refs)] #![feature(const_ptr_write)] #![feature(const_precise_live_drops)] diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index 89d85146963..31edbe0c5af 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -237,7 +237,6 @@ mod hack { } } -#[cfg_attr(bootstrap, lang = "slice_alloc")] #[cfg(not(test))] impl [T] { /// Sorts the slice. @@ -267,7 +266,7 @@ impl [T] { /// assert!(v == [-5, -3, 1, 2, 4]); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn sort(&mut self) @@ -323,7 +322,7 @@ impl [T] { /// assert!(v == [5, 4, 3, 2, 1]); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn sort_by(&mut self, mut compare: F) @@ -365,7 +364,7 @@ impl [T] { /// assert!(v == [1, 2, -3, 4, -5]); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "slice_sort_by_key", since = "1.7.0")] #[inline] pub fn sort_by_key(&mut self, mut f: F) @@ -412,7 +411,7 @@ impl [T] { /// /// [pdqsort]: https://github.com/orlp/pdqsort #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "slice_sort_by_cached_key", since = "1.34.0")] #[inline] pub fn sort_by_cached_key(&mut self, f: F) @@ -471,7 +470,7 @@ impl [T] { /// // Here, `s` and `x` can be modified independently. /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[rustc_conversion_suggestion] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -496,7 +495,7 @@ impl [T] { /// // Here, `s` and `x` can be modified independently. /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[inline] #[unstable(feature = "allocator_api", issue = "32838")] pub fn to_vec_in(&self, alloc: A) -> Vec @@ -521,7 +520,7 @@ impl [T] { /// /// assert_eq!(x, vec![10, 40, 30]); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn into_vec(self: Box) -> Vec { @@ -549,7 +548,7 @@ impl [T] { /// // this will panic at runtime /// b"0123456789abcdef".repeat(usize::MAX); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[cfg(not(no_global_oom_handling))] #[stable(feature = "repeat_generic_slice", since = "1.40.0")] pub fn repeat(&self, n: usize) -> Vec @@ -618,7 +617,7 @@ impl [T] { /// assert_eq!(["hello", "world"].concat(), "helloworld"); /// assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] pub fn concat(&self) -> >::Output where @@ -637,7 +636,7 @@ impl [T] { /// assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]); /// assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rename_connect_to_join", since = "1.3.0")] pub fn join(&self, sep: Separator) -> >::Output where @@ -656,7 +655,7 @@ impl [T] { /// assert_eq!(["hello", "world"].connect(" "), "hello world"); /// assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(since = "1.3.0", reason = "renamed to join")] pub fn connect(&self, sep: Separator) -> >::Output @@ -667,7 +666,6 @@ impl [T] { } } -#[cfg_attr(bootstrap, lang = "slice_u8_alloc")] #[cfg(not(test))] impl [u8] { /// Returns a vector containing a copy of this slice where each byte @@ -680,7 +678,7 @@ impl [u8] { /// /// [`make_ascii_uppercase`]: slice::make_ascii_uppercase #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "this returns the uppercase bytes as a new Vec, \ without modifying the original"] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] @@ -701,7 +699,7 @@ impl [u8] { /// /// [`make_ascii_lowercase`]: slice::make_ascii_lowercase #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "this returns the lowercase bytes as a new Vec, \ without modifying the original"] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs index a3c17612c3a..0eaa2639863 100644 --- a/library/alloc/src/str.rs +++ b/library/alloc/src/str.rs @@ -235,7 +235,6 @@ impl ToOwned for str { } /// Methods for string slices. -#[cfg_attr(bootstrap, lang = "str_alloc")] #[cfg(not(test))] impl str { /// Converts a `Box` into a `Box<[u8]>` without copying or allocating. @@ -250,7 +249,7 @@ impl str { /// let boxed_bytes = boxed_str.into_boxed_bytes(); /// assert_eq!(*boxed_bytes, *s.as_bytes()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "str_box_extras", since = "1.20.0")] #[must_use = "`self` will be dropped if the result is not used"] #[inline] @@ -281,7 +280,7 @@ impl str { /// assert_eq!(s, s.replace("cookie monster", "little lamb")); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "this returns the replaced string as a new allocation, \ without modifying the original"] #[stable(feature = "rust1", since = "1.0.0")] @@ -322,7 +321,7 @@ impl str { /// assert_eq!(s, s.replacen("cookie monster", "little lamb", 10)); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "this returns the replaced string as a new allocation, \ without modifying the original"] #[stable(feature = "str_replacen", since = "1.16.0")] @@ -379,7 +378,7 @@ impl str { /// assert_eq!(new_year, new_year.to_lowercase()); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "this returns the lowercase string as a new String, \ without modifying the original"] #[stable(feature = "unicode_case_mapping", since = "1.2.0")] @@ -462,7 +461,7 @@ impl str { /// assert_eq!("TSCHÜSS", s.to_uppercase()); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "this returns the uppercase string as a new String, \ without modifying the original"] #[stable(feature = "unicode_case_mapping", since = "1.2.0")] @@ -498,7 +497,7 @@ impl str { /// assert_eq!(boxed_str.into_string(), string); /// ``` #[stable(feature = "box_str", since = "1.4.0")] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "`self` will be dropped if the result is not used"] #[inline] pub fn into_string(self: Box) -> String { @@ -527,7 +526,7 @@ impl str { /// let huge = "0123456789abcdef".repeat(usize::MAX); /// ``` #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use] #[stable(feature = "repeat_str", since = "1.16.0")] pub fn repeat(&self, n: usize) -> String { @@ -556,7 +555,7 @@ impl str { /// [`make_ascii_uppercase`]: str::make_ascii_uppercase /// [`to_uppercase`]: #method.to_uppercase #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "to uppercase the value in-place, use `make_ascii_uppercase()`"] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] @@ -589,7 +588,7 @@ impl str { /// [`make_ascii_lowercase`]: str::make_ascii_lowercase /// [`to_lowercase`]: #method.to_lowercase #[cfg(not(no_global_oom_handling))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "to lowercase the value in-place, use `make_ascii_lowercase()`"] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 9e42ab5923a..af661e485f5 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -395,7 +395,6 @@ macro_rules! array_impl_default { array_impl_default! {32, T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T} -#[cfg_attr(bootstrap, lang = "array")] impl [T; N] { /// Returns an array of the same size as `self`, with function `f` applied to each element /// in order. diff --git a/library/core/src/bool.rs b/library/core/src/bool.rs index 06aee3ccbaf..36000f8f389 100644 --- a/library/core/src/bool.rs +++ b/library/core/src/bool.rs @@ -2,7 +2,6 @@ use crate::marker::Destruct; -#[cfg_attr(bootstrap, lang = "bool")] impl bool { /// Returns `Some(t)` if the `bool` is [`true`](../std/keyword.true.html), /// or `None` otherwise. @@ -18,10 +17,9 @@ impl bool { #[unstable(feature = "bool_to_option", issue = "80967")] #[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")] #[inline] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn then_some(self, t: T) -> Option where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { if self { Some(t) } else { None } } @@ -38,11 +36,10 @@ impl bool { #[stable(feature = "lazy_bool_to_option", since = "1.50.0")] #[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")] #[inline] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn then(self, f: F) -> Option where F: ~const FnOnce() -> T, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { if self { Some(f()) } else { None } } diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 3195205b1b6..f9b0d69b18e 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -7,7 +7,6 @@ use crate::unicode::{self, conversions}; use super::*; -#[cfg_attr(bootstrap, lang = "char")] impl char { /// The highest valid code point a `char` can have, `'\u{10FFFF}'`. /// diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index cfdc51c71ee..0444a9575d1 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -130,10 +130,9 @@ pub trait Clone: Sized { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[default_method_body_is_const] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping fn clone_from(&mut self, source: &Self) where - Self: ~const Drop + ~const Destruct, + Self: ~const Destruct, { *self = source.clone() } diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 0744e9cf426..cdade0cf997 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -2348,7 +2348,6 @@ pub const unsafe fn write_bytes(dst: *mut T, val: u8, count: usize) { #[rustc_const_unstable(feature = "const_eval_select", issue = "none")] #[lang = "const_eval_select"] #[rustc_do_not_const_check] -#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const unsafe fn const_eval_select( arg: ARG, _called_in_const: F, @@ -2356,7 +2355,7 @@ pub const unsafe fn const_eval_select( ) -> RET where F: ~const FnOnce, - G: FnOnce + ~const Drop + ~const Destruct, + G: FnOnce + ~const Destruct, { called_at_rt.call_once(arg) } @@ -2368,7 +2367,6 @@ where )] #[rustc_const_unstable(feature = "const_eval_select", issue = "none")] #[lang = "const_eval_select_ct"] -#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const unsafe fn const_eval_select_ct( arg: ARG, called_in_const: F, @@ -2376,7 +2374,7 @@ pub const unsafe fn const_eval_select_ct( ) -> RET where F: ~const FnOnce, - G: FnOnce + ~const Drop + ~const Destruct, + G: FnOnce + ~const Destruct, { called_in_const.call_once(arg) } diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index e13f50b0d7a..660f6d92fe1 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -84,7 +84,7 @@ target_has_atomic_load_store = "ptr", ))] #![no_core] -#![cfg_attr(not(bootstrap), rustc_coherence_is_core)] +#![rustc_coherence_is_core] // // Lints: #![deny(rust_2021_incompatible_or_patterns)] @@ -163,15 +163,12 @@ #![feature(cfg_target_has_atomic)] #![feature(cfg_target_has_atomic_equal_alignment)] #![feature(const_fn_floating_point_arithmetic)] -#![cfg_attr(bootstrap, feature(const_fn_fn_ptr_basics))] -#![cfg_attr(bootstrap, feature(const_fn_trait_bound))] -#![cfg_attr(bootstrap, feature(const_impl_trait))] #![feature(const_mut_refs)] #![feature(const_precise_live_drops)] #![feature(const_refs_to_cell)] #![feature(decl_macro)] #![feature(derive_default_enum)] -#![cfg_attr(not(bootstrap), feature(deprecated_suggestion))] +#![feature(deprecated_suggestion)] #![feature(doc_cfg)] #![feature(doc_notable_trait)] #![feature(rustdoc_internals)] @@ -208,7 +205,6 @@ #![feature(asm_const)] // // Target features: -#![cfg_attr(bootstrap, feature(aarch64_target_feature))] #![feature(arm_target_feature)] #![feature(avx512_target_feature)] #![feature(cmpxchg16b_target_feature)] @@ -220,7 +216,6 @@ #![feature(sse4a_target_feature)] #![feature(tbm_target_feature)] #![feature(wasm_target_feature)] -#![cfg_attr(bootstrap, feature(adx_target_feature))] // allow using `core::` in intra-doc links #[allow(unused_extern_crates)] diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 6b9d6253e42..4a90ef9545d 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -797,17 +797,10 @@ impl Unpin for *mut T {} /// This should be used for `~const` bounds, /// as non-const bounds will always hold for every type. #[unstable(feature = "const_trait_impl", issue = "67792")] -#[cfg_attr(not(bootstrap), lang = "destruct")] -#[cfg_attr( - not(bootstrap), - rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg,) -)] +#[lang = "destruct"] +#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)] pub trait Destruct {} -#[cfg(bootstrap)] -#[unstable(feature = "const_trait_impl", issue = "67792")] -impl const Destruct for T {} - /// Implementations of `Copy` for primitive types. /// /// Implementations that cannot be described in Rust diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index e56e602a662..a983d0872bc 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -370,7 +370,6 @@ pub mod consts { pub const LN_10: f32 = 2.30258509299404568401799145468436421_f32; } -#[cfg_attr(bootstrap, lang = "f32")] #[cfg(not(test))] impl f32 { /// The radix or base of the internal representation of `f32`. diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index 8304caf649c..05598e5fe7b 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -370,7 +370,6 @@ pub mod consts { pub const LN_10: f64 = 2.30258509299404568401799145468436421_f64; } -#[cfg_attr(bootstrap, lang = "f64")] #[cfg(not(test))] impl f64 { /// The radix or base of the internal representation of `f64`. diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index 8cbece0417b..a30d2ff0ea6 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -193,26 +193,22 @@ macro_rules! widening_impl { }; } -#[cfg_attr(bootstrap, lang = "i8")] impl i8 { int_impl! { i8, i8, u8, 8, 7, -128, 127, 2, "-0x7e", "0xa", "0x12", "0x12", "0x48", "[0x12]", "[0x12]", "", "" } } -#[cfg_attr(bootstrap, lang = "i16")] impl i16 { int_impl! { i16, i16, u16, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" } } -#[cfg_attr(bootstrap, lang = "i32")] impl i32 { int_impl! { i32, i32, u32, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301", "0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", "", "" } } -#[cfg_attr(bootstrap, lang = "i64")] impl i64 { int_impl! { i64, i64, u64, 64, 63, -9223372036854775808, 9223372036854775807, 12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412", @@ -220,7 +216,6 @@ impl i64 { "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", "", "" } } -#[cfg_attr(bootstrap, lang = "i128")] impl i128 { int_impl! { i128, i128, u128, 128, 127, -170141183460469231731687303715884105728, 170141183460469231731687303715884105727, 16, @@ -233,7 +228,6 @@ impl i128 { } #[cfg(target_pointer_width = "16")] -#[cfg_attr(bootstrap, lang = "isize")] impl isize { int_impl! { isize, i16, usize, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", @@ -241,7 +235,6 @@ impl isize { } #[cfg(target_pointer_width = "32")] -#[cfg_attr(bootstrap, lang = "isize")] impl isize { int_impl! { isize, i32, usize, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301", "0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", @@ -250,7 +243,6 @@ impl isize { } #[cfg(target_pointer_width = "64")] -#[cfg_attr(bootstrap, lang = "isize")] impl isize { int_impl! { isize, i64, usize, 64, 63, -9223372036854775808, 9223372036854775807, 12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412", @@ -262,7 +254,6 @@ impl isize { /// If 6th bit set ascii is upper case. const ASCII_CASE_MASK: u8 = 0b0010_0000; -#[cfg_attr(bootstrap, lang = "u8")] impl u8 { uint_impl! { u8, u8, i8, NonZeroU8, 8, 255, 2, "0x82", "0xa", "0x12", "0x12", "0x48", "[0x12]", "[0x12]", "", "" } @@ -816,7 +807,6 @@ impl u8 { } } -#[cfg_attr(bootstrap, lang = "u16")] impl u16 { uint_impl! { u16, u16, i16, NonZeroU16, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" } @@ -848,14 +838,12 @@ impl u16 { } } -#[cfg_attr(bootstrap, lang = "u32")] impl u32 { uint_impl! { u32, u32, i32, NonZeroU32, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", "", "" } widening_impl! { u32, u64, 32, unsigned } } -#[cfg_attr(bootstrap, lang = "u64")] impl u64 { uint_impl! { u64, u64, i64, NonZeroU64, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48", @@ -865,7 +853,6 @@ impl u64 { widening_impl! { u64, u128, 64, unsigned } } -#[cfg_attr(bootstrap, lang = "u128")] impl u128 { uint_impl! { u128, u128, i128, NonZeroU128, 128, 340282366920938463463374607431768211455, 16, "0x13f40000000000000000000000004f76", "0x4f7613f4", "0x12345678901234567890123456789012", @@ -878,7 +865,6 @@ impl u128 { } #[cfg(target_pointer_width = "16")] -#[cfg_attr(bootstrap, lang = "usize")] impl usize { uint_impl! { usize, u16, isize, NonZeroUsize, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", @@ -886,7 +872,6 @@ impl usize { widening_impl! { usize, u32, 16, unsigned } } #[cfg(target_pointer_width = "32")] -#[cfg_attr(bootstrap, lang = "usize")] impl usize { uint_impl! { usize, u32, isize, NonZeroUsize, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", @@ -895,7 +880,6 @@ impl usize { } #[cfg(target_pointer_width = "64")] -#[cfg_attr(bootstrap, lang = "usize")] impl usize { uint_impl! { usize, u64, isize, NonZeroUsize, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48", diff --git a/library/core/src/option.rs b/library/core/src/option.rs index b5ca9e35dce..91e4708f6a6 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -773,10 +773,9 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn unwrap_or(self, default: T) -> T where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { match self { Some(x) => x, @@ -796,11 +795,10 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn unwrap_or_else(self, f: F) -> T where F: ~const FnOnce() -> T, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { match self { Some(x) => x, @@ -902,11 +900,10 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn map(self, f: F) -> Option where F: ~const FnOnce(T) -> U, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { match self { Some(x) => Some(f(x)), @@ -932,11 +929,10 @@ impl Option { #[inline] #[unstable(feature = "result_option_inspect", issue = "91345")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn inspect(self, f: F) -> Self where F: ~const FnOnce(&T), - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { if let Some(ref x) = self { f(x); @@ -966,12 +962,11 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn map_or(self, default: U, f: F) -> U where F: ~const FnOnce(T) -> U, - F: ~const Drop + ~const Destruct, - U: ~const Drop + ~const Destruct, + F: ~const Destruct, + U: ~const Destruct, { match self { Some(t) => f(t), @@ -996,13 +991,12 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn map_or_else(self, default: D, f: F) -> U where D: ~const FnOnce() -> U, - D: ~const Drop + ~const Destruct, + D: ~const Destruct, F: ~const FnOnce(T) -> U, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { match self { Some(t) => f(t), @@ -1034,10 +1028,9 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn ok_or(self, err: E) -> Result where - E: ~const Drop + ~const Destruct, + E: ~const Destruct, { match self { Some(v) => Ok(v), @@ -1064,11 +1057,10 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn ok_or_else(self, err: F) -> Result where F: ~const FnOnce() -> E, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { match self { Some(v) => Ok(v), @@ -1199,11 +1191,10 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn and(self, optb: Option) -> Option where - T: ~const Drop + ~const Destruct, - U: ~const Drop + ~const Destruct, + T: ~const Destruct, + U: ~const Destruct, { match self { Some(_) => optb, @@ -1242,11 +1233,10 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn and_then(self, f: F) -> Option where F: ~const FnOnce(T) -> Option, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { match self { Some(x) => f(x), @@ -1281,12 +1271,11 @@ impl Option { #[inline] #[stable(feature = "option_filter", since = "1.27.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn filter

(self, predicate: P) -> Self where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, P: ~const FnOnce(&T) -> bool, - P: ~const Drop + ~const Destruct, + P: ~const Destruct, { if let Some(x) = self { if predicate(&x) { @@ -1326,10 +1315,9 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn or(self, optb: Option) -> Option where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { match self { Some(x) => Some(x), @@ -1353,11 +1341,10 @@ impl Option { #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn or_else(self, f: F) -> Option where F: ~const FnOnce() -> Option, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { match self { Some(x) => Some(x), @@ -1389,10 +1376,9 @@ impl Option { #[inline] #[stable(feature = "option_xor", since = "1.37.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn xor(self, optb: Option) -> Option where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { match (self, optb) { (Some(a), None) => Some(a), @@ -1428,10 +1414,9 @@ impl Option { #[inline] #[stable(feature = "option_insert", since = "1.53.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn insert(&mut self, value: T) -> &mut T where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { *self = Some(value); @@ -1462,10 +1447,9 @@ impl Option { #[inline] #[stable(feature = "option_entry", since = "1.20.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn get_or_insert(&mut self, value: T) -> &mut T where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { if let None = *self { *self = Some(value); @@ -1530,11 +1514,10 @@ impl Option { #[inline] #[stable(feature = "option_entry", since = "1.20.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn get_or_insert_with(&mut self, f: F) -> &mut T where F: ~const FnOnce() -> T, - F: ~const Drop + ~const Destruct, + F: ~const Destruct, { if let None = *self { // the compiler isn't smart enough to know that we are not dropping a `T` @@ -1645,11 +1628,10 @@ impl Option { /// ``` #[stable(feature = "option_zip_option", since = "1.46.0")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn zip(self, other: Option) -> Option<(T, U)> where - T: ~const Drop + ~const Destruct, - U: ~const Drop + ~const Destruct, + T: ~const Destruct, + U: ~const Destruct, { match (self, other) { (Some(a), Some(b)) => Some((a, b)), @@ -1687,13 +1669,12 @@ impl Option { /// ``` #[unstable(feature = "option_zip", issue = "70086")] #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] - #[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping pub const fn zip_with(self, other: Option, f: F) -> Option where F: ~const FnOnce(T, U) -> R, - F: ~const Drop + ~const Destruct, - T: ~const Drop + ~const Destruct, - U: ~const Drop + ~const Destruct, + F: ~const Destruct, + T: ~const Destruct, + U: ~const Destruct, { match (self, other) { (Some(a), Some(b)) => Some(f(a, b)), @@ -1880,10 +1861,9 @@ const fn expect_failed(msg: &str) -> ! { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_clone", issue = "91805")] -#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping impl const Clone for Option where - T: ~const Clone + ~const Drop + ~const Destruct, + T: ~const Clone + ~const Destruct, { #[inline] fn clone(&self) -> Self { diff --git a/library/core/src/panicking.rs b/library/core/src/panicking.rs index a908b1f3ba4..7a575a88e52 100644 --- a/library/core/src/panicking.rs +++ b/library/core/src/panicking.rs @@ -88,7 +88,6 @@ fn panic_bounds_check(index: usize, len: usize) -> ! { // any extra arguments (including those synthesized by track_caller). #[cold] #[inline(never)] -#[cfg_attr(bootstrap, track_caller)] #[lang = "panic_no_unwind"] // needed by codegen for panic in nounwind function fn panic_no_unwind() -> ! { if cfg!(feature = "panic_immediate_abort") { diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index f862912432e..68f39dc4347 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -4,7 +4,6 @@ use crate::intrinsics; use crate::mem; use crate::slice::{self, SliceIndex}; -#[cfg_attr(bootstrap, lang = "const_ptr")] impl *const T { /// Returns `true` if the pointer is null. /// @@ -1086,7 +1085,6 @@ impl *const T { } } -#[cfg_attr(bootstrap, lang = "const_slice_ptr")] impl *const [T] { /// Returns the length of a raw slice. /// diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 5db9c3e941e..4c9b0f7cc0c 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -3,7 +3,6 @@ use crate::cmp::Ordering::{self, Equal, Greater, Less}; use crate::intrinsics; use crate::slice::{self, SliceIndex}; -#[cfg_attr(bootstrap, lang = "mut_ptr")] impl *mut T { /// Returns `true` if the pointer is null. /// @@ -1357,7 +1356,6 @@ impl *mut T { } } -#[cfg_attr(bootstrap, lang = "mut_slice_ptr")] impl *mut [T] { /// Returns the length of a raw slice. /// diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 641749be366..b2b132300a2 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -636,7 +636,7 @@ impl Result { #[rustc_const_unstable(feature = "const_result_drop", issue = "92384")] pub const fn ok(self) -> Option where - E: ~const Drop + ~const Destruct, + E: ~const Destruct, { match self { Ok(x) => Some(x), @@ -667,7 +667,7 @@ impl Result { #[rustc_const_unstable(feature = "const_result_drop", issue = "92384")] pub const fn err(self) -> Option where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { match self { // FIXME: ~const Drop doesn't quite work right yet @@ -1283,9 +1283,9 @@ impl Result { #[stable(feature = "rust1", since = "1.0.0")] pub const fn and(self, res: Result) -> Result where - T: ~const Drop + ~const Destruct, - U: ~const Drop + ~const Destruct, - E: ~const Drop + ~const Destruct, + T: ~const Destruct, + U: ~const Destruct, + E: ~const Destruct, { match self { // FIXME: ~const Drop doesn't quite work right yet @@ -1368,9 +1368,9 @@ impl Result { #[stable(feature = "rust1", since = "1.0.0")] pub const fn or(self, res: Result) -> Result where - T: ~const Drop + ~const Destruct, - E: ~const Drop + ~const Destruct, - F: ~const Drop + ~const Destruct, + T: ~const Destruct, + E: ~const Destruct, + F: ~const Destruct, { match self { Ok(v) => Ok(v), @@ -1432,8 +1432,8 @@ impl Result { #[stable(feature = "rust1", since = "1.0.0")] pub const fn unwrap_or(self, default: T) -> T where - T: ~const Drop + ~const Destruct, - E: ~const Drop + ~const Destruct, + T: ~const Destruct, + E: ~const Destruct, { match self { Ok(t) => t, @@ -1803,11 +1803,10 @@ fn unwrap_failed(_msg: &str, _error: &T) -> ! { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_clone", issue = "91805")] -#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping impl const Clone for Result where - T: ~const Clone + ~const Drop + ~const Destruct, - E: ~const Clone + ~const Drop + ~const Destruct, + T: ~const Clone + ~const Destruct, + E: ~const Clone + ~const Destruct, { #[inline] fn clone(&self) -> Self { diff --git a/library/core/src/slice/ascii.rs b/library/core/src/slice/ascii.rs index 7c002130040..9aa5c88a62c 100644 --- a/library/core/src/slice/ascii.rs +++ b/library/core/src/slice/ascii.rs @@ -6,7 +6,6 @@ use crate::iter; use crate::mem; use crate::ops; -#[cfg_attr(bootstrap, lang = "slice_u8")] #[cfg(not(test))] impl [u8] { /// Checks if all bytes in this slice are within the ASCII range. diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 17f6373ecbf..fe084a40b6a 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -110,7 +110,6 @@ enum Direction { Back, } -#[cfg_attr(bootstrap, lang = "slice")] #[cfg(not(test))] impl [T] { /// Returns the number of elements in the slice. diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 6bfa6a5e015..bd05b2e791d 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -130,7 +130,6 @@ fn slice_error_fail_rt(s: &str, begin: usize, end: usize) -> ! { ); } -#[cfg_attr(bootstrap, lang = "str")] #[cfg(not(test))] impl str { /// Returns the length of `self`. diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 5338cd07757..4a020e59e9c 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -20,8 +20,6 @@ #![feature(rustc_allow_const_fn_unstable)] #![feature(nll)] #![feature(staged_api)] -#![cfg_attr(bootstrap, feature(const_fn_trait_bound))] -#![cfg_attr(bootstrap, feature(const_fn_fn_ptr_basics))] #![feature(allow_internal_unstable)] #![feature(decl_macro)] #![feature(extern_types)] diff --git a/library/std/src/alloc.rs b/library/std/src/alloc.rs index ae11964cb56..49b6cd4232c 100644 --- a/library/std/src/alloc.rs +++ b/library/std/src/alloc.rs @@ -315,14 +315,11 @@ pub fn take_alloc_error_hook() -> fn(Layout) { } fn default_alloc_error_hook(layout: Layout) { - #[cfg(not(bootstrap))] extern "Rust" { // This symbol is emitted by rustc next to __rust_alloc_error_handler. // Its value depends on the -Zoom={panic,abort} compiler option. static __rust_alloc_error_handler_should_panic: u8; } - #[cfg(bootstrap)] - let __rust_alloc_error_handler_should_panic = 0; #[allow(unused_unsafe)] if unsafe { __rust_alloc_error_handler_should_panic != 0 } { diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index 70b5941c7c7..ac288c599f3 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -28,7 +28,6 @@ pub use core::f32::{ }; #[cfg(not(test))] -#[cfg_attr(bootstrap, lang = "f32_runtime")] impl f32 { /// Returns the largest integer less than or equal to a number. /// @@ -43,7 +42,7 @@ impl f32 { /// assert_eq!(g.floor(), 3.0); /// assert_eq!(h.floor(), -4.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -62,7 +61,7 @@ impl f32 { /// assert_eq!(f.ceil(), 4.0); /// assert_eq!(g.ceil(), 4.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -82,7 +81,7 @@ impl f32 { /// assert_eq!(f.round(), 3.0); /// assert_eq!(g.round(), -3.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -103,7 +102,7 @@ impl f32 { /// assert_eq!(g.trunc(), 3.0); /// assert_eq!(h.trunc(), -3.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -124,7 +123,7 @@ impl f32 { /// assert!(abs_difference_x <= f32::EPSILON); /// assert!(abs_difference_y <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -149,7 +148,7 @@ impl f32 { /// /// assert!(f32::NAN.abs().is_nan()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -173,7 +172,7 @@ impl f32 { /// /// assert!(f32::NAN.signum().is_nan()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -200,7 +199,7 @@ impl f32 { /// /// assert!(f32::NAN.copysign(1.0).is_nan()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[inline] #[stable(feature = "copysign", since = "1.35.0")] @@ -228,7 +227,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -253,7 +252,7 @@ impl f32 { /// assert_eq!(a.div_euclid(-b), -1.0); // 7.0 >= -4.0 * -1.0 /// assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0 /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[inline] #[stable(feature = "euclidean_division", since = "1.38.0")] @@ -288,7 +287,7 @@ impl f32 { /// // limitation due to round-off error /// assert!((-f32::EPSILON).rem_euclid(3.0) != 0.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[inline] #[stable(feature = "euclidean_division", since = "1.38.0")] @@ -309,7 +308,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -327,7 +326,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -352,7 +351,7 @@ impl f32 { /// assert!(negative.sqrt().is_nan()); /// assert!(negative_zero.sqrt() == negative_zero); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -374,7 +373,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -394,7 +393,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -416,7 +415,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -440,7 +439,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -460,7 +459,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -483,7 +482,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -508,7 +507,7 @@ impl f32 { /// assert!(abs_difference_x <= f32::EPSILON); /// assert!(abs_difference_y <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -538,7 +537,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -560,7 +559,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -579,7 +578,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -598,7 +597,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -616,7 +615,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -638,7 +637,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -660,7 +659,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -681,7 +680,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -715,7 +714,7 @@ impl f32 { /// assert!(abs_difference_1 <= f32::EPSILON); /// assert!(abs_difference_2 <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -738,7 +737,7 @@ impl f32 { /// assert!(abs_difference_0 <= f32::EPSILON); /// assert!(abs_difference_1 <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn sin_cos(self) -> (f32, f32) { @@ -759,7 +758,7 @@ impl f32 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -781,7 +780,7 @@ impl f32 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -804,7 +803,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -827,7 +826,7 @@ impl f32 { /// // Same result /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -850,7 +849,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -870,7 +869,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -890,7 +889,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -910,7 +909,7 @@ impl f32 { /// /// assert!(abs_difference <= 1e-5); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index b90d068ec10..01279f01b05 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -28,7 +28,6 @@ pub use core::f64::{ }; #[cfg(not(test))] -#[cfg_attr(bootstrap, lang = "f64_runtime")] impl f64 { /// Returns the largest integer less than or equal to a number. /// @@ -43,7 +42,7 @@ impl f64 { /// assert_eq!(g.floor(), 3.0); /// assert_eq!(h.floor(), -4.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -62,7 +61,7 @@ impl f64 { /// assert_eq!(f.ceil(), 4.0); /// assert_eq!(g.ceil(), 4.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -82,7 +81,7 @@ impl f64 { /// assert_eq!(f.round(), 3.0); /// assert_eq!(g.round(), -3.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -103,7 +102,7 @@ impl f64 { /// assert_eq!(g.trunc(), 3.0); /// assert_eq!(h.trunc(), -3.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -124,7 +123,7 @@ impl f64 { /// assert!(abs_difference_x < 1e-10); /// assert!(abs_difference_y < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -149,7 +148,7 @@ impl f64 { /// /// assert!(f64::NAN.abs().is_nan()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -173,7 +172,7 @@ impl f64 { /// /// assert!(f64::NAN.signum().is_nan()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -200,7 +199,7 @@ impl f64 { /// /// assert!(f64::NAN.copysign(1.0).is_nan()); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "copysign", since = "1.35.0")] #[inline] @@ -228,7 +227,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -253,7 +252,7 @@ impl f64 { /// assert_eq!(a.div_euclid(-b), -1.0); // 7.0 >= -4.0 * -1.0 /// assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0 /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[inline] #[stable(feature = "euclidean_division", since = "1.38.0")] @@ -288,7 +287,7 @@ impl f64 { /// // limitation due to round-off error /// assert!((-f64::EPSILON).rem_euclid(3.0) != 0.0); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[inline] #[stable(feature = "euclidean_division", since = "1.38.0")] @@ -309,7 +308,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -327,7 +326,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -352,7 +351,7 @@ impl f64 { /// assert!(negative.sqrt().is_nan()); /// assert!(negative_zero.sqrt() == negative_zero); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -374,7 +373,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -394,7 +393,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -416,7 +415,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -440,7 +439,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -460,7 +459,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -485,7 +484,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -510,7 +509,7 @@ impl f64 { /// assert!(abs_difference_x < 1e-10); /// assert!(abs_difference_y < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -540,7 +539,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -562,7 +561,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -581,7 +580,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -600,7 +599,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -618,7 +617,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-14); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -640,7 +639,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -662,7 +661,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -683,7 +682,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -717,7 +716,7 @@ impl f64 { /// assert!(abs_difference_1 < 1e-10); /// assert!(abs_difference_2 < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -740,7 +739,7 @@ impl f64 { /// assert!(abs_difference_0 < 1e-10); /// assert!(abs_difference_1 < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn sin_cos(self) -> (f64, f64) { @@ -761,7 +760,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-20); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -783,7 +782,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-20); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -806,7 +805,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -829,7 +828,7 @@ impl f64 { /// // Same result /// assert!(abs_difference < 1.0e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -852,7 +851,7 @@ impl f64 { /// /// assert!(abs_difference < 1.0e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -872,7 +871,7 @@ impl f64 { /// /// assert!(abs_difference < 1.0e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -892,7 +891,7 @@ impl f64 { /// /// assert!(abs_difference < 1.0e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -912,7 +911,7 @@ impl f64 { /// /// assert!(abs_difference < 1.0e-10); /// ``` - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] @@ -923,7 +922,7 @@ impl f64 { // Solaris/Illumos requires a wrapper around log, log2, and log10 functions // because of their non-standard behavior (e.g., log(-n) returns -Inf instead // of expected NaN). - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] fn log_wrapper f64>(self, log_fn: F) -> f64 { if !cfg!(any(target_os = "solaris", target_os = "illumos")) { log_fn(self) diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 1016fbc99d8..5ade65ad9c6 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -228,12 +228,10 @@ #![feature(c_unwind)] #![feature(cfg_target_thread_local)] #![feature(concat_idents)] -#![cfg_attr(bootstrap, feature(const_fn_fn_ptr_basics))] -#![cfg_attr(bootstrap, feature(const_fn_trait_bound))] #![feature(const_mut_refs)] #![feature(const_trait_impl)] #![feature(decl_macro)] -#![cfg_attr(not(bootstrap), feature(deprecated_suggestion))] +#![feature(deprecated_suggestion)] #![feature(doc_cfg)] #![feature(doc_cfg_hide)] #![feature(doc_masked)] diff --git a/library/test/src/console.rs b/library/test/src/console.rs index 56eef8314fb..dc0123cf432 100644 --- a/library/test/src/console.rs +++ b/library/test/src/console.rs @@ -103,12 +103,7 @@ impl ConsoleTestState { exec_time: Option<&TestExecTime>, ) -> io::Result<()> { self.write_log(|| { - let TestDesc { - name, - #[cfg(not(bootstrap))] - ignore_message, - .. - } = test; + let TestDesc { name, ignore_message, .. } = test; format!( "{} {}", match *result { @@ -116,14 +111,11 @@ impl ConsoleTestState { TestResult::TrFailed => "failed".to_owned(), TestResult::TrFailedMsg(ref msg) => format!("failed: {msg}"), TestResult::TrIgnored => { - #[cfg(not(bootstrap))] if let Some(msg) = ignore_message { format!("ignored: {msg}") } else { "ignored".to_owned() } - #[cfg(bootstrap)] - "ignored".to_owned() } TestResult::TrBench(ref bs) => fmt_bench_samples(bs), TestResult::TrTimedFail => "failed (time limit exceeded)".to_owned(), diff --git a/library/test/src/formatters/json.rs b/library/test/src/formatters/json.rs index 737921c1e10..c07fdafb167 100644 --- a/library/test/src/formatters/json.rs +++ b/library/test/src/formatters/json.rs @@ -120,22 +120,16 @@ impl OutputFormatter for JsonFormatter { Some(&*format!(r#""message": "{}""#, EscapedString(m))), ), - TestResult::TrIgnored => { - #[cfg(not(bootstrap))] - return self.write_event( - "test", - desc.name.as_slice(), - "ignored", - exec_time, - stdout, - desc.ignore_message - .map(|msg| format!(r#""message": "{}""#, EscapedString(msg))) - .as_deref(), - ); - - #[cfg(bootstrap)] - self.write_event("test", desc.name.as_slice(), "ignored", exec_time, stdout, None) - } + TestResult::TrIgnored => self.write_event( + "test", + desc.name.as_slice(), + "ignored", + exec_time, + stdout, + desc.ignore_message + .map(|msg| format!(r#""message": "{}""#, EscapedString(msg))) + .as_deref(), + ), TestResult::TrBench(ref bs) => { let median = bs.ns_iter_summ.median as usize; diff --git a/library/test/src/formatters/pretty.rs b/library/test/src/formatters/pretty.rs index 9b407df2190..69420222980 100644 --- a/library/test/src/formatters/pretty.rs +++ b/library/test/src/formatters/pretty.rs @@ -218,12 +218,7 @@ impl OutputFormatter for PrettyFormatter { match *result { TestResult::TrOk => self.write_ok()?, TestResult::TrFailed | TestResult::TrFailedMsg(_) => self.write_failed()?, - TestResult::TrIgnored => { - #[cfg(not(bootstrap))] - self.write_ignored(desc.ignore_message)?; - #[cfg(bootstrap)] - self.write_ignored(None)?; - } + TestResult::TrIgnored => self.write_ignored(desc.ignore_message)?, TestResult::TrBench(ref bs) => { self.write_bench()?; self.write_plain(&format!(": {}", fmt_bench_samples(bs)))?; diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs index 8329e9735d4..0b81aff5907 100644 --- a/library/test/src/tests.rs +++ b/library/test/src/tests.rs @@ -61,7 +61,6 @@ fn one_ignored_one_unignored_test() -> Vec { desc: TestDesc { name: StaticTestName("1"), ignore: true, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -74,7 +73,6 @@ fn one_ignored_one_unignored_test() -> Vec { desc: TestDesc { name: StaticTestName("2"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -95,7 +93,6 @@ pub fn do_not_run_ignored_tests() { desc: TestDesc { name: StaticTestName("whatever"), ignore: true, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -117,7 +114,6 @@ pub fn ignored_tests_result_in_ignored() { desc: TestDesc { name: StaticTestName("whatever"), ignore: true, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -143,7 +139,6 @@ fn test_should_panic() { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::Yes, compile_fail: false, @@ -169,7 +164,6 @@ fn test_should_panic_good_message() { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::YesWithMessage("error message"), compile_fail: false, @@ -200,7 +194,6 @@ fn test_should_panic_bad_message() { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::YesWithMessage(expected), compile_fail: false, @@ -235,7 +228,6 @@ fn test_should_panic_non_string_message_type() { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::YesWithMessage(expected), compile_fail: false, @@ -262,7 +254,6 @@ fn test_should_panic_but_succeeds() { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic, compile_fail: false, @@ -297,7 +288,6 @@ fn report_time_test_template(report_time: bool) -> Option { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -333,7 +323,6 @@ fn time_test_failure_template(test_type: TestType) -> TestResult { desc: TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -373,7 +362,6 @@ fn typed_test_desc(test_type: TestType) -> TestDesc { TestDesc { name: StaticTestName("whatever"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -486,7 +474,6 @@ pub fn exclude_should_panic_option() { desc: TestDesc { name: StaticTestName("3"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::Yes, compile_fail: false, @@ -511,7 +498,6 @@ pub fn exact_filter_match() { desc: TestDesc { name: StaticTestName(name), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -601,7 +587,6 @@ fn sample_tests() -> Vec { desc: TestDesc { name: DynTestName((*name).clone()), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -753,7 +738,6 @@ pub fn test_bench_no_iter() { let desc = TestDesc { name: StaticTestName("f"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -776,7 +760,6 @@ pub fn test_bench_iter() { let desc = TestDesc { name: StaticTestName("f"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -793,7 +776,6 @@ fn should_sort_failures_before_printing_them() { let test_a = TestDesc { name: StaticTestName("a"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, @@ -804,7 +786,6 @@ fn should_sort_failures_before_printing_them() { let test_b = TestDesc { name: StaticTestName("b"), ignore: false, - #[cfg(not(bootstrap))] ignore_message: None, should_panic: ShouldPanic::No, compile_fail: false, diff --git a/library/test/src/types.rs b/library/test/src/types.rs index 1084fb98389..ffb1efe18cc 100644 --- a/library/test/src/types.rs +++ b/library/test/src/types.rs @@ -117,7 +117,6 @@ pub struct TestId(pub usize); pub struct TestDesc { pub name: TestName, pub ignore: bool, - #[cfg(not(bootstrap))] pub ignore_message: Option<&'static str>, pub should_panic: options::ShouldPanic, pub compile_fail: bool, diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs index 82f1e63f4b5..a01b56004c4 100644 --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs @@ -1,7 +1,6 @@ #![no_std] #![unstable(feature = "panic_unwind", issue = "32837")] #![feature(link_cfg)] -#![cfg_attr(bootstrap, feature(native_link_modifiers))] #![feature(native_link_modifiers_bundle)] #![feature(nll)] #![feature(staged_api)] diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 63b744133a2..50ae22b99cd 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -1019,7 +1019,6 @@ impl Tester for Collector { Ignore::None => false, Ignore::Some(ref ignores) => ignores.iter().any(|s| target_str.contains(s)), }, - #[cfg(not(bootstrap))] ignore_message: None, // compiler failures are test failures should_panic: test::ShouldPanic::No, diff --git a/src/test/ui/target-feature/tied-features.rs b/src/test/ui/target-feature/tied-features.rs index 048777cb3ba..15f01505eba 100644 --- a/src/test/ui/target-feature/tied-features.rs +++ b/src/test/ui/target-feature/tied-features.rs @@ -1,7 +1,6 @@ // build-fail // compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu // needs-llvm-components: aarch64 -#![cfg_attr(bootstrap, feature(aarch64_target_feature))] #![feature(no_core, lang_items)] #![no_core] diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 1bdea33dffa..8a72b44e2b5 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -806,8 +806,7 @@ pub fn make_test_description( cfg: Option<&str>, ) -> test::TestDesc { let mut ignore = false; - #[cfg(not(bootstrap))] - let ignore_message: Option = None; + let ignore_message = None; let mut should_fail = false; let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some(); @@ -879,7 +878,6 @@ pub fn make_test_description( test::TestDesc { name, ignore, - #[cfg(not(bootstrap))] ignore_message, should_panic, compile_fail: false,