From 9ed92df98867a5acd525ab09f9c67337e72c5989 Mon Sep 17 00:00:00 2001 From: Boxy Date: Mon, 2 Sep 2024 17:48:42 +0100 Subject: [PATCH 1/2] replace placeholder version --- alloc/src/boxed.rs | 8 ++++---- alloc/src/collections/binary_heap/mod.rs | 2 +- alloc/src/collections/btree/map.rs | 4 ++-- alloc/src/collections/vec_deque/iter.rs | 2 +- alloc/src/collections/vec_deque/iter_mut.rs | 2 +- alloc/src/rc.rs | 8 ++++---- alloc/src/sync.rs | 8 ++++---- core/src/future/ready.rs | 2 +- core/src/iter/adapters/take.rs | 6 +++--- core/src/iter/mod.rs | 2 +- core/src/iter/sources.rs | 2 +- core/src/iter/sources/repeat_n.rs | 16 ++++++++-------- core/src/iter/traits/iterator.rs | 6 +++--- core/src/num/error.rs | 2 +- core/src/num/mod.rs | 6 +++--- core/src/option.rs | 2 +- core/src/slice/mod.rs | 6 +++--- core/src/str/iter.rs | 2 +- core/src/task/wake.rs | 10 +++++----- std/src/thread/mod.rs | 2 +- 20 files changed, 49 insertions(+), 49 deletions(-) diff --git a/alloc/src/boxed.rs b/alloc/src/boxed.rs index a924feaf15f2a..6dc75478700ce 100644 --- a/alloc/src/boxed.rs +++ b/alloc/src/boxed.rs @@ -272,7 +272,7 @@ impl Box { /// assert_eq!(*five, 5) /// ``` #[cfg(not(no_global_oom_handling))] - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use] #[inline] pub fn new_uninit() -> Box> { @@ -663,7 +663,7 @@ impl Box<[T]> { /// assert_eq!(*values, [1, 2, 3]) /// ``` #[cfg(not(no_global_oom_handling))] - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use] pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit]> { unsafe { RawVec::with_capacity(len).into_box(len) } @@ -930,7 +930,7 @@ impl Box, A> { /// /// assert_eq!(*five, 5) /// ``` - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[inline] pub unsafe fn assume_init(self) -> Box { let (raw, alloc) = Box::into_raw_with_allocator(self); @@ -1003,7 +1003,7 @@ impl Box<[mem::MaybeUninit], A> { /// /// assert_eq!(*values, [1, 2, 3]) /// ``` - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[inline] pub unsafe fn assume_init(self) -> Box<[T], A> { let (raw, alloc) = Box::into_raw_with_allocator(self); diff --git a/alloc/src/collections/binary_heap/mod.rs b/alloc/src/collections/binary_heap/mod.rs index 88701370c1056..fe9f1010d327c 100644 --- a/alloc/src/collections/binary_heap/mod.rs +++ b/alloc/src/collections/binary_heap/mod.rs @@ -1433,7 +1433,7 @@ pub struct Iter<'a, T: 'a> { iter: slice::Iter<'a, T>, } -#[stable(feature = "default_iters_sequel", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "default_iters_sequel", since = "1.82.0")] impl Default for Iter<'_, T> { /// Creates an empty `binary_heap::Iter`. /// diff --git a/alloc/src/collections/btree/map.rs b/alloc/src/collections/btree/map.rs index c7908578522a5..60e08b47e3d35 100644 --- a/alloc/src/collections/btree/map.rs +++ b/alloc/src/collections/btree/map.rs @@ -2016,7 +2016,7 @@ impl Default for Range<'_, K, V> { } } -#[stable(feature = "default_iters_sequel", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "default_iters_sequel", since = "1.82.0")] impl Default for RangeMut<'_, K, V> { /// Creates an empty `btree_map::RangeMut`. /// @@ -2064,7 +2064,7 @@ impl ExactSizeIterator for ValuesMut<'_, K, V> { #[stable(feature = "fused", since = "1.26.0")] impl FusedIterator for ValuesMut<'_, K, V> {} -#[stable(feature = "default_iters_sequel", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "default_iters_sequel", since = "1.82.0")] impl Default for ValuesMut<'_, K, V> { /// Creates an empty `btree_map::ValuesMut`. /// diff --git a/alloc/src/collections/vec_deque/iter.rs b/alloc/src/collections/vec_deque/iter.rs index 67b5b91c4d4b0..bf4dd66f47638 100644 --- a/alloc/src/collections/vec_deque/iter.rs +++ b/alloc/src/collections/vec_deque/iter.rs @@ -28,7 +28,7 @@ impl fmt::Debug for Iter<'_, T> { } } -#[stable(feature = "default_iters_sequel", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "default_iters_sequel", since = "1.82.0")] impl Default for Iter<'_, T> { /// Creates an empty `vec_deque::Iter`. /// diff --git a/alloc/src/collections/vec_deque/iter_mut.rs b/alloc/src/collections/vec_deque/iter_mut.rs index 2726e3e425290..7a349a1b4edd0 100644 --- a/alloc/src/collections/vec_deque/iter_mut.rs +++ b/alloc/src/collections/vec_deque/iter_mut.rs @@ -28,7 +28,7 @@ impl fmt::Debug for IterMut<'_, T> { } } -#[stable(feature = "default_iters_sequel", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "default_iters_sequel", since = "1.82.0")] impl Default for IterMut<'_, T> { /// Creates an empty `vec_deque::IterMut`. /// diff --git a/alloc/src/rc.rs b/alloc/src/rc.rs index 1b31a78394eca..88c7a12db23ca 100644 --- a/alloc/src/rc.rs +++ b/alloc/src/rc.rs @@ -517,7 +517,7 @@ impl Rc { /// assert_eq!(*five, 5) /// ``` #[cfg(not(no_global_oom_handling))] - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use] pub fn new_uninit() -> Rc> { unsafe { @@ -980,7 +980,7 @@ impl Rc<[T]> { /// assert_eq!(*values, [1, 2, 3]) /// ``` #[cfg(not(no_global_oom_handling))] - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use] pub fn new_uninit_slice(len: usize) -> Rc<[mem::MaybeUninit]> { unsafe { Rc::from_ptr(Rc::allocate_for_slice(len)) } @@ -1127,7 +1127,7 @@ impl Rc, A> { /// /// assert_eq!(*five, 5) /// ``` - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[inline] pub unsafe fn assume_init(self) -> Rc { let (ptr, alloc) = Rc::into_inner_with_allocator(self); @@ -1167,7 +1167,7 @@ impl Rc<[mem::MaybeUninit], A> { /// /// assert_eq!(*values, [1, 2, 3]) /// ``` - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[inline] pub unsafe fn assume_init(self) -> Rc<[T], A> { let (ptr, alloc) = Rc::into_inner_with_allocator(self); diff --git a/alloc/src/sync.rs b/alloc/src/sync.rs index 024a794f17b01..43684f31cb723 100644 --- a/alloc/src/sync.rs +++ b/alloc/src/sync.rs @@ -520,7 +520,7 @@ impl Arc { /// ``` #[cfg(not(no_global_oom_handling))] #[inline] - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use] pub fn new_uninit() -> Arc> { unsafe { @@ -1115,7 +1115,7 @@ impl Arc<[T]> { /// ``` #[cfg(not(no_global_oom_handling))] #[inline] - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use] pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit]> { unsafe { Arc::from_ptr(Arc::allocate_for_slice(len)) } @@ -1262,7 +1262,7 @@ impl Arc, A> { /// /// assert_eq!(*five, 5) /// ``` - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use = "`self` will be dropped if the result is not used"] #[inline] pub unsafe fn assume_init(self) -> Arc { @@ -1303,7 +1303,7 @@ impl Arc<[mem::MaybeUninit], A> { /// /// assert_eq!(*values, [1, 2, 3]) /// ``` - #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "new_uninit", since = "1.82.0")] #[must_use = "`self` will be dropped if the result is not used"] #[inline] pub unsafe fn assume_init(self) -> Arc<[T], A> { diff --git a/core/src/future/ready.rs b/core/src/future/ready.rs index 6f6da8ce51ddf..b562ad4d8860d 100644 --- a/core/src/future/ready.rs +++ b/core/src/future/ready.rs @@ -39,7 +39,7 @@ impl Ready { /// let a = future::ready(1); /// assert_eq!(a.into_inner(), 1); /// ``` - #[stable(feature = "ready_into_inner", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "ready_into_inner", since = "1.82.0")] #[must_use] #[inline] pub fn into_inner(self) -> T { diff --git a/core/src/iter/adapters/take.rs b/core/src/iter/adapters/take.rs index 4c8f9fe16da0f..b96335f415257 100644 --- a/core/src/iter/adapters/take.rs +++ b/core/src/iter/adapters/take.rs @@ -318,7 +318,7 @@ impl SpecTake for Take { } } -#[stable(feature = "exact_size_take_repeat", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "exact_size_take_repeat", since = "1.82.0")] impl DoubleEndedIterator for Take> { #[inline] fn next_back(&mut self) -> Option { @@ -361,14 +361,14 @@ impl DoubleEndedIterator for Take> { // because we have no way to return value of nth invocation of repeater followed // by n-1st without remembering all results. -#[stable(feature = "exact_size_take_repeat", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "exact_size_take_repeat", since = "1.82.0")] impl ExactSizeIterator for Take> { fn len(&self) -> usize { self.n } } -#[stable(feature = "exact_size_take_repeat", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "exact_size_take_repeat", since = "1.82.0")] impl A, A> ExactSizeIterator for Take> { fn len(&self) -> usize { self.n diff --git a/core/src/iter/mod.rs b/core/src/iter/mod.rs index 5dad9e1a75ed6..387963d0afd01 100644 --- a/core/src/iter/mod.rs +++ b/core/src/iter/mod.rs @@ -436,7 +436,7 @@ pub use self::sources::{once, Once}; pub use self::sources::{once_with, OnceWith}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::sources::{repeat, Repeat}; -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] pub use self::sources::{repeat_n, RepeatN}; #[stable(feature = "iterator_repeat_with", since = "1.28.0")] pub use self::sources::{repeat_with, RepeatWith}; diff --git a/core/src/iter/sources.rs b/core/src/iter/sources.rs index 55901e1e50b42..2c726fbca8760 100644 --- a/core/src/iter/sources.rs +++ b/core/src/iter/sources.rs @@ -24,7 +24,7 @@ pub use self::once::{once, Once}; pub use self::once_with::{once_with, OnceWith}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::repeat::{repeat, Repeat}; -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] pub use self::repeat_n::{repeat_n, RepeatN}; #[stable(feature = "iterator_repeat_with", since = "1.28.0")] pub use self::repeat_with::{repeat_with, RepeatWith}; diff --git a/core/src/iter/sources/repeat_n.rs b/core/src/iter/sources/repeat_n.rs index 2e247a34075c4..9c0621933638e 100644 --- a/core/src/iter/sources/repeat_n.rs +++ b/core/src/iter/sources/repeat_n.rs @@ -56,7 +56,7 @@ use crate::num::NonZero; /// assert_eq!(None, it.next()); /// ``` #[inline] -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] pub fn repeat_n(element: T, count: usize) -> RepeatN { let mut element = ManuallyDrop::new(element); @@ -75,7 +75,7 @@ pub fn repeat_n(element: T, count: usize) -> RepeatN { /// This `struct` is created by the [`repeat_n()`] function. /// See its documentation for more. #[derive(Clone, Debug)] -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] pub struct RepeatN { count: usize, // Invariant: has been dropped iff count == 0. @@ -99,14 +99,14 @@ impl RepeatN { } } -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] impl Drop for RepeatN { fn drop(&mut self) { self.take_element(); } } -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] impl Iterator for RepeatN { type Item = A; @@ -154,14 +154,14 @@ impl Iterator for RepeatN { } } -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] impl ExactSizeIterator for RepeatN { fn len(&self) -> usize { self.count } } -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] impl DoubleEndedIterator for RepeatN { #[inline] fn next_back(&mut self) -> Option { @@ -179,12 +179,12 @@ impl DoubleEndedIterator for RepeatN { } } -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] impl FusedIterator for RepeatN {} #[unstable(feature = "trusted_len", issue = "37572")] unsafe impl TrustedLen for RepeatN {} -#[stable(feature = "iter_repeat_n", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "iter_repeat_n", since = "1.82.0")] impl UncheckedIterator for RepeatN { #[inline] unsafe fn next_unchecked(&mut self) -> Self::Item { diff --git a/core/src/iter/traits/iterator.rs b/core/src/iter/traits/iterator.rs index 50a2d952e5b36..8352486ad416e 100644 --- a/core/src/iter/traits/iterator.rs +++ b/core/src/iter/traits/iterator.rs @@ -3953,7 +3953,7 @@ pub trait Iterator { /// assert!(![0.0, 1.0, f32::NAN].iter().is_sorted()); /// ``` #[inline] - #[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_sorted", since = "1.82.0")] #[rustc_do_not_const_check] fn is_sorted(self) -> bool where @@ -3980,7 +3980,7 @@ pub trait Iterator { /// assert!(std::iter::empty::().is_sorted_by(|a, b| false)); /// assert!(std::iter::empty::().is_sorted_by(|a, b| true)); /// ``` - #[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_sorted", since = "1.82.0")] #[rustc_do_not_const_check] fn is_sorted_by(mut self, compare: F) -> bool where @@ -4025,7 +4025,7 @@ pub trait Iterator { /// assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs())); /// ``` #[inline] - #[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_sorted", since = "1.82.0")] #[rustc_do_not_const_check] fn is_sorted_by_key(self, f: F) -> bool where diff --git a/core/src/num/error.rs b/core/src/num/error.rs index b8e22a8aef955..6ef2fdd14c149 100644 --- a/core/src/num/error.rs +++ b/core/src/num/error.rs @@ -113,7 +113,7 @@ pub enum IntErrorKind { impl ParseIntError { /// Outputs the detailed cause of parsing an integer failing. #[must_use] - #[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_int_from_str", since = "1.82.0")] #[stable(feature = "int_error_matching", since = "1.55.0")] pub const fn kind(&self) -> &IntErrorKind { &self.kind diff --git a/core/src/num/mod.rs b/core/src/num/mod.rs index e9e5324666ada..37c9db7f474b5 100644 --- a/core/src/num/mod.rs +++ b/core/src/num/mod.rs @@ -1385,7 +1385,7 @@ from_str_radix_int_impl! { isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128 } #[doc(hidden)] #[inline(always)] #[unstable(issue = "none", feature = "std_internals")] -#[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_stable(feature = "const_int_from_str", since = "1.82.0")] pub const fn can_not_overflow(radix: u32, is_signed_ty: bool, digits: &[u8]) -> bool { radix <= 16 && digits.len() <= mem::size_of::() * 2 - is_signed_ty as usize } @@ -1435,7 +1435,7 @@ macro_rules! from_str_radix { #[doc = concat!("assert_eq!(", stringify!($int_ty), "::from_str_radix(\"A\", 16), Ok(10));")] /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_int_from_str", since = "1.82.0")] pub const fn from_str_radix(src: &str, radix: u32) -> Result<$int_ty, ParseIntError> { use self::IntErrorKind::*; use self::ParseIntError as PIE; @@ -1565,7 +1565,7 @@ macro_rules! from_str_radix_size_impl { #[doc = concat!("assert_eq!(", stringify!($size), "::from_str_radix(\"A\", 16), Ok(10));")] /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_int_from_str", since = "1.82.0")] pub const fn from_str_radix(src: &str, radix: u32) -> Result<$size, ParseIntError> { match <$t>::from_str_radix(src, radix) { Ok(x) => Ok(x as $size), diff --git a/core/src/option.rs b/core/src/option.rs index 50cb22b7eb3f5..212e4f0215463 100644 --- a/core/src/option.rs +++ b/core/src/option.rs @@ -667,7 +667,7 @@ impl Option { /// ``` #[must_use] #[inline] - #[stable(feature = "is_none_or", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_none_or", since = "1.82.0")] pub fn is_none_or(self, f: impl FnOnce(T) -> bool) -> bool { match self { None => true, diff --git a/core/src/slice/mod.rs b/core/src/slice/mod.rs index c7918499d4ab9..166189f4b6cf3 100644 --- a/core/src/slice/mod.rs +++ b/core/src/slice/mod.rs @@ -4088,7 +4088,7 @@ impl [T] { /// assert!(![0.0, 1.0, f32::NAN].is_sorted()); /// ``` #[inline] - #[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_sorted", since = "1.82.0")] #[must_use] pub fn is_sorted(&self) -> bool where @@ -4115,7 +4115,7 @@ impl [T] { /// assert!(empty.is_sorted_by(|a, b| false)); /// assert!(empty.is_sorted_by(|a, b| true)); /// ``` - #[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_sorted", since = "1.82.0")] #[must_use] pub fn is_sorted_by<'a, F>(&'a self, mut compare: F) -> bool where @@ -4139,7 +4139,7 @@ impl [T] { /// assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs())); /// ``` #[inline] - #[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_sorted", since = "1.82.0")] #[must_use] pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool where diff --git a/core/src/str/iter.rs b/core/src/str/iter.rs index 681ec79c0b7bf..d9301a8a66ea2 100644 --- a/core/src/str/iter.rs +++ b/core/src/str/iter.rs @@ -269,7 +269,7 @@ impl<'a> CharIndices<'a> { /// ``` #[inline] #[must_use] - #[stable(feature = "char_indices_offset", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "char_indices_offset", since = "1.82.0")] pub fn offset(&self) -> usize { self.front_offset } diff --git a/core/src/task/wake.rs b/core/src/task/wake.rs index 7e5c1574f5367..1761584cfc4e3 100644 --- a/core/src/task/wake.rs +++ b/core/src/task/wake.rs @@ -250,7 +250,7 @@ pub struct Context<'a> { impl<'a> Context<'a> { /// Creates a new `Context` from a [`&Waker`](Waker). #[stable(feature = "futures_api", since = "1.36.0")] - #[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_waker", since = "1.82.0")] #[must_use] #[inline] pub const fn from_waker(waker: &'a Waker) -> Self { @@ -261,7 +261,7 @@ impl<'a> Context<'a> { #[inline] #[must_use] #[stable(feature = "futures_api", since = "1.36.0")] - #[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_waker", since = "1.82.0")] pub const fn waker(&self) -> &'a Waker { &self.waker } @@ -337,7 +337,7 @@ impl<'a> ContextBuilder<'a> { /// Creates a ContextBuilder from a Waker. #[inline] #[unstable(feature = "local_waker", issue = "118959")] - #[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_waker", since = "1.82.0")] pub const fn from_waker(waker: &'a Waker) -> Self { // SAFETY: LocalWaker is just Waker without thread safety let local_waker = unsafe { transmute(waker) }; @@ -395,7 +395,7 @@ impl<'a> ContextBuilder<'a> { /// Builds the `Context`. #[inline] #[unstable(feature = "local_waker", issue = "118959")] - #[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_waker", since = "1.82.0")] pub const fn build(self) -> Context<'a> { let ContextBuilder { waker, local_waker, ext, _marker, _marker2 } = self; Context { waker, local_waker, ext: AssertUnwindSafe(ext), _marker, _marker2 } @@ -523,7 +523,7 @@ impl Waker { #[inline] #[must_use] #[stable(feature = "futures_api", since = "1.36.0")] - #[rustc_const_stable(feature = "const_waker", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_waker", since = "1.82.0")] pub const unsafe fn from_raw(waker: RawWaker) -> Waker { Waker { waker } } diff --git a/std/src/thread/mod.rs b/std/src/thread/mod.rs index e29c28f3c7ec2..0fc63c5081b03 100644 --- a/std/src/thread/mod.rs +++ b/std/src/thread/mod.rs @@ -432,7 +432,7 @@ impl Builder { /// ``` /// /// [`io::Result`]: crate::io::Result - #[stable(feature = "thread_spawn_unchecked", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "thread_spawn_unchecked", since = "1.82.0")] pub unsafe fn spawn_unchecked(self, f: F) -> io::Result> where F: FnOnce() -> T, From 349f8d57256721f01036b79f8cef1a4b83e29e1c Mon Sep 17 00:00:00 2001 From: Boxy Date: Thu, 5 Sep 2024 17:23:40 +0100 Subject: [PATCH 2/2] update cfgs --- alloc/src/collections/vec_deque/into_iter.rs | 4 --- core/src/arch.rs | 9 ------ core/src/cell.rs | 6 ++-- core/src/clone.rs | 2 +- core/src/default.rs | 2 +- core/src/intrinsics.rs | 7 ----- core/src/lib.rs | 4 --- core/src/marker.rs | 17 +++--------- core/src/mem/manually_drop.rs | 2 +- core/src/mem/maybe_uninit.rs | 2 +- core/src/mem/mod.rs | 1 - core/src/mem/transmutability.rs | 29 +++++++------------- core/src/pin.rs | 2 +- core/src/tuple.rs | 2 +- core/tests/lib.rs | 1 - panic_unwind/src/seh.rs | 6 ---- std/src/env.rs | 16 +++-------- std/src/lib.rs | 1 - std/src/os/unix/process.rs | 6 +--- 19 files changed, 28 insertions(+), 91 deletions(-) diff --git a/alloc/src/collections/vec_deque/into_iter.rs b/alloc/src/collections/vec_deque/into_iter.rs index 7be3de16b2da7..2b09a5e7ddc58 100644 --- a/alloc/src/collections/vec_deque/into_iter.rs +++ b/alloc/src/collections/vec_deque/into_iter.rs @@ -121,8 +121,6 @@ impl Iterator for IntoIter { { match self.try_fold(init, |b, item| Ok::(f(b, item))) { Ok(b) => b, - #[cfg(bootstrap)] - Err(e) => match e {}, } } @@ -243,8 +241,6 @@ impl DoubleEndedIterator for IntoIter { { match self.try_rfold(init, |b, item| Ok::(f(b, item))) { Ok(b) => b, - #[cfg(bootstrap)] - Err(e) => match e {}, } } } diff --git a/core/src/arch.rs b/core/src/arch.rs index d681bd124fe13..31d6bc36fc8b9 100644 --- a/core/src/arch.rs +++ b/core/src/arch.rs @@ -4,15 +4,6 @@ #[stable(feature = "simd_arch", since = "1.27.0")] pub use crate::core_arch::arch::*; -#[cfg(bootstrap)] -#[allow(dead_code)] -#[unstable(feature = "sha512_sm_x86", issue = "126624")] -fn dummy() { - // AArch64 also has a target feature named `sm4`, so we need `#![feature(sha512_sm_x86)]` in lib.rs - // But as the bootstrap compiler doesn't know about this feature yet, we need to convert it to a - // library feature until bootstrap gets bumped -} - /// Inline assembly. /// /// Refer to [Rust By Example] for a usage guide and the [reference] for diff --git a/core/src/cell.rs b/core/src/cell.rs index 5dd9721d3fee8..a3a471a57c7aa 100644 --- a/core/src/cell.rs +++ b/core/src/cell.rs @@ -306,7 +306,7 @@ pub use once::OnceCell; /// See the [module-level documentation](self) for more. #[stable(feature = "rust1", since = "1.0.0")] #[repr(transparent)] -#[cfg_attr(not(bootstrap), rustc_pub_transparent)] +#[rustc_pub_transparent] pub struct Cell { value: UnsafeCell, } @@ -2056,7 +2056,7 @@ impl fmt::Display for RefMut<'_, T> { #[lang = "unsafe_cell"] #[stable(feature = "rust1", since = "1.0.0")] #[repr(transparent)] -#[cfg_attr(not(bootstrap), rustc_pub_transparent)] +#[rustc_pub_transparent] pub struct UnsafeCell { value: T, } @@ -2299,7 +2299,7 @@ impl UnsafeCell<*mut T> { /// See [`UnsafeCell`] for details. #[unstable(feature = "sync_unsafe_cell", issue = "95439")] #[repr(transparent)] -#[cfg_attr(not(bootstrap), rustc_pub_transparent)] +#[rustc_pub_transparent] pub struct SyncUnsafeCell { value: UnsafeCell, } diff --git a/core/src/clone.rs b/core/src/clone.rs index 2150463067205..c5f8bd7401e5e 100644 --- a/core/src/clone.rs +++ b/core/src/clone.rs @@ -161,7 +161,7 @@ pub trait Clone: Sized { #[must_use = "cloning is often expensive and is not expected to have side effects"] // Clone::clone is special because the compiler generates MIR to implement it for some types. // See InstanceKind::CloneShim. - #[cfg_attr(not(bootstrap), lang = "clone_fn")] + #[lang = "clone_fn"] fn clone(&self) -> Self; /// Performs copy-assignment from `source`. diff --git a/core/src/default.rs b/core/src/default.rs index 5cacedcb241a5..4c30290ff263b 100644 --- a/core/src/default.rs +++ b/core/src/default.rs @@ -103,7 +103,7 @@ use crate::ascii::Char as AsciiChar; /// ``` #[cfg_attr(not(test), rustc_diagnostic_item = "Default")] #[stable(feature = "rust1", since = "1.0.0")] -#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)] +#[rustc_trivial_field_reads] pub trait Default: Sized { /// Returns the "default value" for a type. /// diff --git a/core/src/intrinsics.rs b/core/src/intrinsics.rs index 8cb9accd59db4..7870a62ea81cd 100644 --- a/core/src/intrinsics.rs +++ b/core/src/intrinsics.rs @@ -1020,7 +1020,6 @@ pub const fn unlikely(b: bool) -> bool { /// any safety invariants. /// /// This intrinsic does not have a stable counterpart. -#[cfg(not(bootstrap))] #[unstable(feature = "core_intrinsics", issue = "none")] #[rustc_intrinsic] #[rustc_nounwind] @@ -1030,12 +1029,6 @@ pub fn select_unpredictable(b: bool, true_val: T, false_val: T) -> T { if b { true_val } else { false_val } } -#[cfg(bootstrap)] -#[inline] -pub fn select_unpredictable(b: bool, true_val: T, false_val: T) -> T { - if b { true_val } else { false_val } -} - extern "rust-intrinsic" { /// Executes a breakpoint trap, for inspection by a debugger. /// diff --git a/core/src/lib.rs b/core/src/lib.rs index e60bcf3aa5db7..50e9884fea1b4 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -107,7 +107,6 @@ // // Library features: // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(offset_of_nested))] #![feature(array_ptr_get)] #![feature(asm_experimental_arch)] #![feature(const_align_of_val)] @@ -192,9 +191,6 @@ // // Language features: // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(asm_const))] -#![cfg_attr(bootstrap, feature(const_fn_floating_point_arithmetic))] -#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))] #![feature(abi_unadjusted)] #![feature(adt_const_params)] #![feature(allow_internal_unsafe)] diff --git a/core/src/marker.rs b/core/src/marker.rs index 5654f5aa4b8d2..84bb0119453f2 100644 --- a/core/src/marker.rs +++ b/core/src/marker.rs @@ -992,7 +992,7 @@ pub macro ConstParamTy($item:item) { /* compiler built-in */ } -#[cfg_attr(not(bootstrap), lang = "unsized_const_param_ty")] +#[lang = "unsized_const_param_ty"] #[unstable(feature = "unsized_const_params", issue = "95174")] #[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")] /// A marker for types which can be used as types of `const` generic parameters. @@ -1002,10 +1002,9 @@ pub macro ConstParamTy($item:item) { pub trait UnsizedConstParamTy: StructuralPartialEq + Eq {} /// Derive macro generating an impl of the trait `ConstParamTy`. -#[cfg(not(bootstrap))] -#[cfg_attr(not(bootstrap), rustc_builtin_macro)] -#[cfg_attr(not(bootstrap), allow_internal_unstable(unsized_const_params))] -#[cfg_attr(not(bootstrap), unstable(feature = "unsized_const_params", issue = "95174"))] +#[rustc_builtin_macro] +#[allow_internal_unstable(unsized_const_params)] +#[unstable(feature = "unsized_const_params", issue = "95174")] pub macro UnsizedConstParamTy($item:item) { /* compiler built-in */ } @@ -1021,14 +1020,6 @@ marker_impls! { (), {T: ConstParamTy_, const N: usize} [T; N], } -#[cfg(bootstrap)] -marker_impls! { - #[unstable(feature = "adt_const_params", issue = "95174")] - ConstParamTy_ for - str, - {T: ConstParamTy_} [T], - {T: ConstParamTy_ + ?Sized} &T, -} marker_impls! { #[unstable(feature = "unsized_const_params", issue = "95174")] diff --git a/core/src/mem/manually_drop.rs b/core/src/mem/manually_drop.rs index be5cee2e85267..3e47785ee488e 100644 --- a/core/src/mem/manually_drop.rs +++ b/core/src/mem/manually_drop.rs @@ -47,7 +47,7 @@ use crate::ptr; #[lang = "manually_drop"] #[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] -#[cfg_attr(not(bootstrap), rustc_pub_transparent)] +#[rustc_pub_transparent] pub struct ManuallyDrop { value: T, } diff --git a/core/src/mem/maybe_uninit.rs b/core/src/mem/maybe_uninit.rs index c308def2f574a..4be2e5ef1eade 100644 --- a/core/src/mem/maybe_uninit.rs +++ b/core/src/mem/maybe_uninit.rs @@ -237,7 +237,7 @@ use crate::{fmt, intrinsics, ptr, slice}; #[lang = "maybe_uninit"] #[derive(Copy)] #[repr(transparent)] -#[cfg_attr(not(bootstrap), rustc_pub_transparent)] +#[rustc_pub_transparent] pub union MaybeUninit { uninit: (), value: ManuallyDrop, diff --git a/core/src/mem/mod.rs b/core/src/mem/mod.rs index fed484ae3cd12..414262fcf5ab1 100644 --- a/core/src/mem/mod.rs +++ b/core/src/mem/mod.rs @@ -1326,7 +1326,6 @@ impl SizedTypeProperties for T {} /// # Examples /// /// ``` -/// # #![cfg_attr(bootstrap, feature(offset_of_nested))] /// #![feature(offset_of_enum)] /// /// use std::mem; diff --git a/core/src/mem/transmutability.rs b/core/src/mem/transmutability.rs index cda999a7f0c91..7fa3c33439170 100644 --- a/core/src/mem/transmutability.rs +++ b/core/src/mem/transmutability.rs @@ -43,8 +43,7 @@ use crate::marker::{ConstParamTy_, UnsizedConstParamTy}; /// conversions that extend the bits of `Src` with trailing padding to fill /// trailing uninitialized bytes of `Self`; e.g.: /// -#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] -#[cfg_attr(not(bootstrap), doc = "```rust")] +/// ```rust /// #![feature(transmutability)] /// /// use core::mem::{Assume, TransmuteFrom}; @@ -151,8 +150,7 @@ pub struct Assume { /// When `false`, [`TransmuteFrom`] is not implemented for transmutations /// that might violate the alignment requirements of references; e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")] + /// ```compile_fail,E0277 /// #![feature(transmutability)] /// use core::mem::{align_of, TransmuteFrom}; /// @@ -171,8 +169,7 @@ pub struct Assume { /// that references in the transmuted value satisfy the alignment /// requirements of their referent types; e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```rust")] + /// ```rust /// #![feature(pointer_is_aligned_to, transmutability)] /// use core::mem::{align_of, Assume, TransmuteFrom}; /// @@ -203,8 +200,7 @@ pub struct Assume { /// that might violate the library safety invariants of the destination /// type; e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")] + /// ```compile_fail,E0277 /// #![feature(transmutability)] /// use core::mem::TransmuteFrom; /// @@ -225,8 +221,7 @@ pub struct Assume { /// that undefined behavior does not arise from using the transmuted value; /// e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```rust")] + /// ```rust /// #![feature(transmutability)] /// use core::mem::{Assume, TransmuteFrom}; /// @@ -254,8 +249,7 @@ pub struct Assume { /// that might violate the language-level bit-validity invariant of the /// destination type; e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")] + /// ```compile_fail,E0277 /// #![feature(transmutability)] /// use core::mem::TransmuteFrom; /// @@ -271,8 +265,7 @@ pub struct Assume { /// that the value being transmuted is a bit-valid instance of the /// transmuted value; e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```rust")] + /// ```rust /// #![feature(transmutability)] /// use core::mem::{Assume, TransmuteFrom}; /// @@ -335,9 +328,7 @@ impl Assume { /// This is especially useful for extending [`Assume`] in generic contexts; /// e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```rust")] - #[unstable(feature = "transmutability", issue = "99571")] + /// ```rust /// #![feature( /// adt_const_params, /// generic_const_exprs, @@ -379,6 +370,7 @@ impl Assume { /// try_transmute_ref::<_, _, { Assume::NOTHING }>(src) /// }; ///``` + #[unstable(feature = "transmutability", issue = "99571")] pub const fn and(self, other_assumptions: Self) -> Self { Self { alignment: self.alignment || other_assumptions.alignment, @@ -390,8 +382,7 @@ impl Assume { /// Remove `other_assumptions` the obligations of `self`; e.g.: /// - #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")] - #[cfg_attr(not(bootstrap), doc = "```rust")] + /// ```rust /// #![feature(transmutability)] /// use core::mem::Assume; /// diff --git a/core/src/pin.rs b/core/src/pin.rs index 65f6bfb7ee176..9c13662e08e8f 100644 --- a/core/src/pin.rs +++ b/core/src/pin.rs @@ -1084,7 +1084,7 @@ use crate::{cmp, fmt}; #[lang = "pin"] #[fundamental] #[repr(transparent)] -#[cfg_attr(not(bootstrap), rustc_pub_transparent)] +#[rustc_pub_transparent] #[derive(Copy, Clone)] pub struct Pin { // FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to: diff --git a/core/src/tuple.rs b/core/src/tuple.rs index 9ec92e2845034..206b5b9e2c24f 100644 --- a/core/src/tuple.rs +++ b/core/src/tuple.rs @@ -154,7 +154,7 @@ macro_rules! tuple_impls { // Otherwise, it hides the docs entirely. macro_rules! maybe_tuple_doc { ($a:ident @ #[$meta:meta] $item:item) => { - #[cfg_attr(not(bootstrap), doc(fake_variadic))] + #[doc(fake_variadic)] #[doc = "This trait is implemented for tuples up to twelve items long."] #[$meta] $item diff --git a/core/tests/lib.rs b/core/tests/lib.rs index c205f028dd3a7..1bee17bc2b92c 100644 --- a/core/tests/lib.rs +++ b/core/tests/lib.rs @@ -1,5 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(offset_of_nested))] #![cfg_attr(target_has_atomic = "128", feature(integer_atomics))] #![cfg_attr(test, feature(cfg_match))] #![feature(alloc_layout_extra)] diff --git a/panic_unwind/src/seh.rs b/panic_unwind/src/seh.rs index 82c248c5a7ba1..070c11926f6e0 100644 --- a/panic_unwind/src/seh.rs +++ b/panic_unwind/src/seh.rs @@ -157,9 +157,6 @@ mod imp { // going to be cross-lang LTOed anyway. However, using expose is shorter and // requires less unsafe. let addr: usize = ptr.expose_provenance(); - #[cfg(bootstrap)] - let image_base = unsafe { addr_of!(__ImageBase) }.addr(); - #[cfg(not(bootstrap))] let image_base = addr_of!(__ImageBase).addr(); let offset: usize = addr - image_base; Self(offset as u32) @@ -253,9 +250,6 @@ extern "C" { // This is fine since the MSVC runtime uses string comparison on the type name // to match TypeDescriptors rather than pointer equality. static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor { - #[cfg(bootstrap)] - pVFTable: unsafe { addr_of!(TYPE_INFO_VTABLE) } as *const _, - #[cfg(not(bootstrap))] pVFTable: addr_of!(TYPE_INFO_VTABLE) as *const _, spare: core::ptr::null_mut(), name: TYPE_NAME, diff --git a/std/src/env.rs b/std/src/env.rs index e06a851658c03..28916130b1900 100644 --- a/std/src/env.rs +++ b/std/src/env.rs @@ -354,12 +354,8 @@ impl Error for VarError { /// } /// assert_eq!(env::var(key), Ok("VALUE".to_string())); /// ``` -#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)] -#[cfg_attr( - not(bootstrap), - rustc_deprecated_safe_2024( - audit_that = "the environment access only happens in single-threaded code" - ) +#[rustc_deprecated_safe_2024( + audit_that = "the environment access only happens in single-threaded code" )] #[stable(feature = "env", since = "1.0.0")] pub unsafe fn set_var, V: AsRef>(key: K, value: V) { @@ -424,12 +420,8 @@ pub unsafe fn set_var, V: AsRef>(key: K, value: V) { /// } /// assert!(env::var(key).is_err()); /// ``` -#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)] -#[cfg_attr( - not(bootstrap), - rustc_deprecated_safe_2024( - audit_that = "the environment access only happens in single-threaded code" - ) +#[rustc_deprecated_safe_2024( + audit_that = "the environment access only happens in single-threaded code" )] #[stable(feature = "env", since = "1.0.0")] pub unsafe fn remove_var>(key: K) { diff --git a/std/src/lib.rs b/std/src/lib.rs index 606d75668c4d5..60969af3e8541 100644 --- a/std/src/lib.rs +++ b/std/src/lib.rs @@ -272,7 +272,6 @@ // // Language features: // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))] #![feature(alloc_error_handler)] #![feature(allocator_internals)] #![feature(allow_internal_unsafe)] diff --git a/std/src/os/unix/process.rs b/std/src/os/unix/process.rs index 46202441d4e38..9aadd9491169f 100644 --- a/std/src/os/unix/process.rs +++ b/std/src/os/unix/process.rs @@ -118,11 +118,7 @@ pub trait CommandExt: Sealed { /// [`pre_exec`]: CommandExt::pre_exec #[stable(feature = "process_exec", since = "1.15.0")] #[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")] - #[cfg_attr(bootstrap, rustc_deprecated_safe_2024)] - #[cfg_attr( - not(bootstrap), - rustc_deprecated_safe_2024(audit_that = "the closure is async-signal-safe") - )] + #[rustc_deprecated_safe_2024(audit_that = "the closure is async-signal-safe")] unsafe fn before_exec(&mut self, f: F) -> &mut process::Command where F: FnMut() -> io::Result<()> + Send + Sync + 'static,