diff options
| author | bors <bors@rust-lang.org> | 2025-05-13 09:54:28 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-13 09:54:28 +0000 | 
| commit | 4eca99a18eab3d4e28ed1ce3ee620d442955a470 (patch) | |
| tree | c1cededa300478e23f6065a9fe8df8a3c14563ca /library/core/src | |
| parent | f6b5da71ea5cc0643906e38178d54483a9bbf1bf (diff) | |
| parent | 8ce7783c7cfff1f60134a7754db32ea86855dd89 (diff) | |
| download | rust-4eca99a18eab3d4e28ed1ce3ee620d442955a470.tar.gz rust-4eca99a18eab3d4e28ed1ce3ee620d442955a470.zip | |
Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errors
Stage0 bootstrap update This PR [follows the release process](https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday) to update the stage0 compiler. The only thing of note is https://github.com/rust-lang/rust/commit/58651d1b316e268fac2100c3ae37bb502a36b8ba, which was flagged by clippy as a correctness fix. I think allowing that lint in our case makes sense, but it's worth to have a second pair of eyes on it. r? `@Mark-Simulacrum`
Diffstat (limited to 'library/core/src')
28 files changed, 57 insertions, 92 deletions
| diff --git a/library/core/src/arch.rs b/library/core/src/arch.rs index f19fde2b4c7..e5078a45c6d 100644 --- a/library/core/src/arch.rs +++ b/library/core/src/arch.rs @@ -32,7 +32,7 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) { /// /// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html /// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html -#[stable(feature = "naked_functions", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "naked_functions", since = "1.88.0")] #[rustc_builtin_macro] pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) { /* compiler built-in */ diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index c7657350a0d..ed523920e42 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -495,7 +495,7 @@ impl<T> Cell<T> { /// ``` #[inline] #[stable(feature = "move_cell", since = "1.17.0")] - #[rustc_const_stable(feature = "const_cell", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_cell", since = "1.88.0")] #[rustc_confusables("swap")] pub const fn replace(&self, val: T) -> T { // SAFETY: This can cause data races if called from a separate thread, @@ -537,7 +537,7 @@ impl<T: Copy> Cell<T> { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_stable(feature = "const_cell", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_cell", since = "1.88.0")] pub const fn get(&self) -> T { // SAFETY: This can cause data races if called from a separate thread, // but `Cell` is `!Sync` so this won't happen. @@ -556,7 +556,7 @@ impl<T: Copy> Cell<T> { /// assert_eq!(c.get(), 6); /// ``` #[inline] - #[stable(feature = "cell_update", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "cell_update", since = "1.88.0")] pub fn update(&self, f: impl FnOnce(T) -> T) { let old = self.get(); self.set(f(old)); @@ -608,7 +608,7 @@ impl<T: ?Sized> Cell<T> { /// ``` #[inline] #[stable(feature = "cell_get_mut", since = "1.11.0")] - #[rustc_const_stable(feature = "const_cell", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_cell", since = "1.88.0")] pub const fn get_mut(&mut self) -> &mut T { self.value.get_mut() } @@ -628,7 +628,7 @@ impl<T: ?Sized> Cell<T> { /// ``` #[inline] #[stable(feature = "as_cell", since = "1.37.0")] - #[rustc_const_stable(feature = "const_cell", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_cell", since = "1.88.0")] pub const fn from_mut(t: &mut T) -> &Cell<T> { // SAFETY: `&mut` ensures unique access. unsafe { &*(t as *mut T as *const Cell<T>) } @@ -686,7 +686,7 @@ impl<T> Cell<[T]> { /// assert_eq!(slice_cell.len(), 3); /// ``` #[stable(feature = "as_cell", since = "1.37.0")] - #[rustc_const_stable(feature = "const_cell", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_cell", since = "1.88.0")] pub const fn as_slice_of_cells(&self) -> &[Cell<T>] { // SAFETY: `Cell<T>` has the same memory layout as `T`. unsafe { &*(self as *const Cell<[T]> as *const [Cell<T>]) } diff --git a/library/core/src/char/convert.rs b/library/core/src/char/convert.rs index d820965a746..fd17f92f7be 100644 --- a/library/core/src/char/convert.rs +++ b/library/core/src/char/convert.rs @@ -21,7 +21,7 @@ pub(super) const fn from_u32(i: u32) -> Option<char> { /// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`]. #[inline] #[must_use] -#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] +#[allow(unnecessary_transmutes)] pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char { // SAFETY: the caller must guarantee that `i` is a valid char value. unsafe { @@ -222,7 +222,7 @@ impl FromStr for char { } #[inline] -#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] +#[allow(unnecessary_transmutes)] const fn char_try_from_u32(i: u32) -> Result<char, CharTryFromError> { // This is an optimized version of the check // (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF), diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs index c9c73a25d89..288d0df0d05 100644 --- a/library/core/src/ffi/mod.rs +++ b/library/core/src/ffi/mod.rs @@ -20,7 +20,7 @@ pub use self::c_str::FromBytesUntilNulError; pub use self::c_str::FromBytesWithNulError; use crate::fmt; -#[stable(feature = "c_str_module", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "c_str_module", since = "1.88.0")] pub mod c_str; #[unstable( diff --git a/library/core/src/fmt/rt.rs b/library/core/src/fmt/rt.rs index c2a8a39bcac..7fd8d3e5b53 100644 --- a/library/core/src/fmt/rt.rs +++ b/library/core/src/fmt/rt.rs @@ -19,14 +19,6 @@ pub struct Placeholder { pub width: Count, } -#[cfg(bootstrap)] -impl Placeholder { - #[inline] - pub const fn new(position: usize, flags: u32, precision: Count, width: Count) -> Self { - Self { position, flags, precision, width } - } -} - /// Used by [width](https://doc.rust-lang.org/std/fmt/#width) /// and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers. #[lang = "format_count"] diff --git a/library/core/src/future/async_drop.rs b/library/core/src/future/async_drop.rs index fc4f95a98b4..c48c3f2ba28 100644 --- a/library/core/src/future/async_drop.rs +++ b/library/core/src/future/async_drop.rs @@ -24,7 +24,6 @@ use crate::task::{Context, Poll}; /// are `Copy` get implicitly duplicated by the compiler, making it very /// hard to predict when, and how often destructors will be executed. As such, /// these types cannot have destructors. -#[cfg(not(bootstrap))] #[unstable(feature = "async_drop", issue = "126482")] #[lang = "async_drop"] pub trait AsyncDrop { @@ -42,7 +41,6 @@ pub trait AsyncDrop { } /// Async drop. -#[cfg(not(bootstrap))] #[unstable(feature = "async_drop", issue = "126482")] #[lang = "async_drop_in_place"] pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) { diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs index 4b5a2f34d3f..2b16a568b40 100644 --- a/library/core/src/future/mod.rs +++ b/library/core/src/future/mod.rs @@ -20,7 +20,6 @@ mod pending; mod poll_fn; mod ready; -#[cfg(not(bootstrap))] #[unstable(feature = "async_drop", issue = "126482")] pub use async_drop::{AsyncDrop, async_drop_in_place}; #[stable(feature = "into_future", since = "1.64.0")] diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index cb83540c4ea..6eefb304689 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -782,7 +782,7 @@ pub const fn cold_path() { /// # assert_eq!(bucket_one.len() + bucket_two.len(), 1); /// ``` #[inline(always)] -#[stable(feature = "select_unpredictable", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "select_unpredictable", since = "1.88.0")] pub fn select_unpredictable<T>(condition: bool, true_val: T, false_val: T) -> T { // FIXME(https://github.com/rust-lang/unsafe-code-guidelines/issues/245): // Change this to use ManuallyDrop instead. diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index c7220fe7c4a..effdc3c63ee 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -1476,7 +1476,7 @@ pub const fn forget<T: ?Sized>(_: T); /// Turning raw bytes (`[u8; SZ]`) into `u32`, `f64`, etc.: /// /// ``` -/// # #![cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] +/// # #![allow(unnecessary_transmutes)] /// let raw_bytes = [0x78, 0x56, 0x34, 0x12]; /// /// let num = unsafe { @@ -3413,7 +3413,6 @@ pub const fn contract_check_requires<C: Fn() -> bool + Copy>(cond: C) { /// returns false. /// /// Note that this function is a no-op during constant evaluation. -#[cfg(not(bootstrap))] #[unstable(feature = "contracts_internals", issue = "128044")] // Similar to `contract_check_requires`, we need to use the user-facing // `contracts` feature rather than the perma-unstable `contracts_internals`. @@ -3437,16 +3436,6 @@ pub const fn contract_check_ensures<C: Fn(&Ret) -> bool + Copy, Ret>(cond: C, re ) } -/// This is the old version of contract_check_ensures kept here for bootstrap only. -#[cfg(bootstrap)] -#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)] -#[rustc_intrinsic] -pub fn contract_check_ensures<'a, Ret, C: Fn(&'a Ret) -> bool>(ret: &'a Ret, cond: C) { - if contract_checks() && !cond(ret) { - crate::panicking::panic_nounwind("failed ensures check"); - } -} - /// The intrinsic will return the size stored in that vtable. /// /// # Safety diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs index 86e3f8509ee..40efc263068 100644 --- a/library/core/src/intrinsics/simd.rs +++ b/library/core/src/intrinsics/simd.rs @@ -34,7 +34,7 @@ pub const unsafe fn simd_extract<T, U>(x: T, idx: u32) -> U; /// /// `idx` must be in-bounds of the vector. #[rustc_nounwind] -#[cfg_attr(not(bootstrap), rustc_intrinsic)] +#[rustc_intrinsic] pub unsafe fn simd_insert_dyn<T, U>(mut x: T, idx: u32, val: U) -> T { // SAFETY: `idx` must be in-bounds unsafe { (&raw mut x).cast::<U>().add(idx as usize).write(val) } @@ -51,7 +51,7 @@ pub unsafe fn simd_insert_dyn<T, U>(mut x: T, idx: u32, val: U) -> T { /// /// `idx` must be in-bounds of the vector. #[rustc_nounwind] -#[cfg_attr(not(bootstrap), rustc_intrinsic)] +#[rustc_intrinsic] pub unsafe fn simd_extract_dyn<T, U>(x: T, idx: u32) -> U { // SAFETY: `idx` must be in-bounds unsafe { (&raw const x).cast::<U>().add(idx as usize).read() } diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 9dc20beda6c..f33b8d188d8 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -885,8 +885,7 @@ marker_impls! { /// /// This is part of [RFC 3467](https://rust-lang.github.io/rfcs/3467-unsafe-pinned.html), and is /// tracked by [#125735](https://github.com/rust-lang/rust/issues/125735). -#[cfg_attr(not(bootstrap), lang = "unsafe_unpin")] -#[cfg_attr(bootstrap, allow(dead_code))] +#[lang = "unsafe_unpin"] pub(crate) unsafe auto trait UnsafeUnpin {} impl<T: ?Sized> !UnsafeUnpin for UnsafePinned<T> {} diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs index 8020b36c6fa..7e470185c86 100644 --- a/library/core/src/num/f128.rs +++ b/library/core/src/num/f128.rs @@ -893,7 +893,7 @@ impl f128 { #[inline] #[unstable(feature = "f128", issue = "116909")] #[must_use = "this returns the result of the operation, without modifying the original"] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn to_bits(self) -> u128 { // SAFETY: `u128` is a plain old datatype so we can always transmute to it. unsafe { mem::transmute(self) } @@ -941,7 +941,7 @@ impl f128 { #[inline] #[must_use] #[unstable(feature = "f128", issue = "116909")] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn from_bits(v: u128) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! // SAFETY: `u128` is a plain old datatype so we can always transmute from it. diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs index 68201400a1d..e47900cba55 100644 --- a/library/core/src/num/f16.rs +++ b/library/core/src/num/f16.rs @@ -881,7 +881,7 @@ impl f16 { #[inline] #[unstable(feature = "f16", issue = "116909")] #[must_use = "this returns the result of the operation, without modifying the original"] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn to_bits(self) -> u16 { // SAFETY: `u16` is a plain old datatype so we can always transmute to it. unsafe { mem::transmute(self) } @@ -928,7 +928,7 @@ impl f16 { #[inline] #[must_use] #[unstable(feature = "f16", issue = "116909")] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn from_bits(v: u16) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! // SAFETY: `u16` is a plain old datatype so we can always transmute from it. diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index da241785d64..5fbc6eb33f1 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -1085,7 +1085,7 @@ impl f32 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")] #[inline] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn to_bits(self) -> u32 { // SAFETY: `u32` is a plain old datatype so we can always transmute to it. unsafe { mem::transmute(self) } @@ -1131,7 +1131,7 @@ impl f32 { #[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")] #[must_use] #[inline] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn from_bits(v: u32) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! // SAFETY: `u32` is a plain old datatype so we can always transmute from it. diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index c8544771a90..81ab0f14c2b 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -1083,7 +1083,7 @@ impl f64 { without modifying the original"] #[stable(feature = "float_bits_conv", since = "1.20.0")] #[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] #[inline] pub const fn to_bits(self) -> u64 { // SAFETY: `u64` is a plain old datatype so we can always transmute to it. @@ -1130,7 +1130,7 @@ impl f64 { #[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")] #[must_use] #[inline] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] pub const fn from_bits(v: u64) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! // SAFETY: `u64` is a plain old datatype so we can always transmute from it. diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 8d31a7b697a..84e1482ed31 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -3675,7 +3675,7 @@ macro_rules! int_impl { /// ``` #[stable(feature = "int_to_from_bytes", since = "1.32.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] // SAFETY: const sound because integers are plain old datatypes so we can always // transmute them to arrays of bytes #[must_use = "this returns the result of the operation, \ @@ -3779,7 +3779,7 @@ macro_rules! int_impl { /// ``` #[stable(feature = "int_to_from_bytes", since = "1.32.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] #[must_use] // SAFETY: const sound because integers are plain old datatypes so we can always // transmute to them diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index bc6cb950816..f38d809c154 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -3523,7 +3523,7 @@ macro_rules! uint_impl { #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] // SAFETY: const sound because integers are plain old datatypes so we can always // transmute them to arrays of bytes #[inline] @@ -3625,7 +3625,7 @@ macro_rules! uint_impl { /// ``` #[stable(feature = "int_to_from_bytes", since = "1.32.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] - #[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))] + #[allow(unnecessary_transmutes)] #[must_use] // SAFETY: const sound because integers are plain old datatypes so we can always // transmute to them diff --git a/library/core/src/ops/index.rs b/library/core/src/ops/index.rs index 8106c088f0b..46e19bed43a 100644 --- a/library/core/src/ops/index.rs +++ b/library/core/src/ops/index.rs @@ -67,7 +67,7 @@ pub trait Index<Idx: ?Sized> { /// /// May panic if the index is out of bounds. #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[track_caller] fn index(&self, index: Idx) -> &Self::Output; } @@ -172,7 +172,7 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> { /// /// May panic if the index is out of bounds. #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[track_caller] fn index_mut(&mut self, index: Idx) -> &mut Self::Output; } diff --git a/library/core/src/panicking.rs b/library/core/src/panicking.rs index 83a45436b30..d87f4814f02 100644 --- a/library/core/src/panicking.rs +++ b/library/core/src/panicking.rs @@ -206,7 +206,6 @@ pub mod panic_const { } // Separated panic constants list for async drop feature // (May be joined when the corresponding lang items will be in the bootstrap) - #[cfg(not(bootstrap))] panic_const! { panic_const_coroutine_resumed_drop = "coroutine resumed after async drop", panic_const_async_fn_resumed_drop = "`async fn` resumed after async drop", diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index dd1c2f2c285..ecfa723722d 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -1093,9 +1093,6 @@ pub use self::unsafe_pinned::UnsafePinned; #[derive(Copy, Clone)] pub struct Pin<Ptr> { /// Only public for bootstrap. - #[cfg(bootstrap)] - pub pointer: Ptr, - #[cfg(not(bootstrap))] pointer: Ptr, } @@ -1936,10 +1933,11 @@ unsafe impl<T: ?Sized> PinCoerceUnsized for *mut T {} /// constructor. /// /// [`Box::pin`]: ../../std/boxed/struct.Box.html#method.pin -#[cfg(not(bootstrap))] #[stable(feature = "pin_macro", since = "1.68.0")] #[rustc_macro_transparency = "semitransparent"] #[allow_internal_unstable(super_let)] +// `super` gets removed by rustfmt +#[rustfmt::skip] pub macro pin($value:expr $(,)?) { { super let mut pinned = $value; @@ -1947,11 +1945,3 @@ pub macro pin($value:expr $(,)?) { unsafe { $crate::pin::Pin::new_unchecked(&mut pinned) } } } - -/// Only for bootstrap. -#[cfg(bootstrap)] -#[stable(feature = "pin_macro", since = "1.68.0")] -#[rustc_macro_transparency = "semitransparent"] -pub macro pin($value:expr $(,)?) { - $crate::pin::Pin::<&mut _> { pointer: &mut { $value } } -} diff --git a/library/core/src/pin/unsafe_pinned.rs b/library/core/src/pin/unsafe_pinned.rs index 5fb628c8adb..f65e83662fe 100644 --- a/library/core/src/pin/unsafe_pinned.rs +++ b/library/core/src/pin/unsafe_pinned.rs @@ -21,7 +21,7 @@ use crate::{fmt, ptr}; /// Use `UnsafeCell` for that. /// /// This type blocks niches the same way `UnsafeCell` does. -#[cfg_attr(not(bootstrap), lang = "unsafe_pinned")] +#[lang = "unsafe_pinned"] #[repr(transparent)] #[unstable(feature = "unsafe_pinned", issue = "125735")] pub struct UnsafePinned<T: ?Sized> { diff --git a/library/core/src/prelude/v1.rs b/library/core/src/prelude/v1.rs index 9737d0baec7..8f1b5275871 100644 --- a/library/core/src/prelude/v1.rs +++ b/library/core/src/prelude/v1.rs @@ -59,7 +59,6 @@ pub use crate::hash::macros::Hash; #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow(deprecated)] -#[cfg_attr(bootstrap, allow(deprecated_in_future))] #[doc(no_inline)] pub use crate::{ assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args, diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 5234fb83eb6..35089b4853d 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -1741,7 +1741,7 @@ impl<T: ?Sized> PartialOrd for *const T { } } -#[stable(feature = "raw_ptr_default", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "raw_ptr_default", since = "1.88.0")] impl<T: ?Sized + Thin> Default for *const T { /// Returns the default value of [`null()`][crate::ptr::null]. fn default() -> Self { diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index aa103af93ff..bd6c4daa509 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -1101,7 +1101,7 @@ pub const unsafe fn swap<T>(x: *mut T, y: *mut T) { /// ``` #[inline] #[stable(feature = "swap_nonoverlapping", since = "1.27.0")] -#[rustc_const_stable(feature = "const_swap_nonoverlapping", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_stable(feature = "const_swap_nonoverlapping", since = "1.88.0")] #[rustc_diagnostic_item = "ptr_swap_nonoverlapping"] #[rustc_allow_const_fn_unstable(const_eval_select)] // both implementations behave the same pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 31b8d3b572c..9cf251742d4 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -1576,7 +1576,7 @@ impl<T: ?Sized> *mut T { /// /// [`ptr::replace`]: crate::ptr::replace() #[stable(feature = "pointer_methods", since = "1.26.0")] - #[rustc_const_stable(feature = "const_inherent_ptr_replace", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_inherent_ptr_replace", since = "1.88.0")] #[inline(always)] pub const unsafe fn replace(self, src: T) -> T where @@ -2159,7 +2159,7 @@ impl<T: ?Sized> PartialOrd for *mut T { } } -#[stable(feature = "raw_ptr_default", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "raw_ptr_default", since = "1.88.0")] impl<T: ?Sized + Thin> Default for *mut T { /// Returns the default value of [`null_mut()`][crate::ptr::null_mut]. fn default() -> Self { diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs index 0864cc457b6..d05fb6a6d31 100644 --- a/library/core/src/ptr/non_null.rs +++ b/library/core/src/ptr/non_null.rs @@ -1166,7 +1166,7 @@ impl<T: ?Sized> NonNull<T> { /// [`ptr::replace`]: crate::ptr::replace() #[inline(always)] #[stable(feature = "non_null_convenience", since = "1.80.0")] - #[rustc_const_stable(feature = "const_inherent_ptr_replace", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "const_inherent_ptr_replace", since = "1.88.0")] pub const unsafe fn replace(self, src: T) -> T where T: Sized, diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 81fe0166fd7..058491b53a1 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -109,7 +109,7 @@ impl<T> [T] { #[lang = "slice_len_fn"] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_slice_len", since = "1.39.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[inline] #[must_use] pub const fn len(&self) -> usize { @@ -129,7 +129,7 @@ impl<T> [T] { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_slice_is_empty", since = "1.39.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[inline] #[must_use] pub const fn is_empty(&self) -> bool { @@ -564,7 +564,7 @@ impl<T> [T] { /// assert_eq!(None, v.get(0..4)); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[inline] #[must_use] pub fn get<I>(&self, index: I) -> Option<&I::Output> @@ -590,7 +590,7 @@ impl<T> [T] { /// assert_eq!(x, &[0, 42, 2]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[inline] #[must_use] pub fn get_mut<I>(&mut self, index: I) -> Option<&mut I::Output> @@ -628,7 +628,7 @@ impl<T> [T] { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[inline] #[must_use] pub unsafe fn get_unchecked<I>(&self, index: I) -> &I::Output @@ -671,7 +671,7 @@ impl<T> [T] { /// assert_eq!(x, &[1, 13, 4]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[inline] #[must_use] pub unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut I::Output @@ -1303,8 +1303,8 @@ impl<T> [T] { /// // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 /// // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed /// ``` - #[stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_as_chunks", since = "1.88.0")] + #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] #[inline] #[must_use] pub const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]] { @@ -1360,8 +1360,8 @@ impl<T> [T] { /// }; /// assert_eq!(chunks, &[['R', 'u'], ['s', 't']]); /// ``` - #[stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_as_chunks", since = "1.88.0")] + #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] #[inline] #[track_caller] #[must_use] @@ -1407,8 +1407,8 @@ impl<T> [T] { /// assert_eq!(remainder, &['l']); /// assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]); /// ``` - #[stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_as_chunks", since = "1.88.0")] + #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] #[inline] #[track_caller] #[must_use] @@ -1498,8 +1498,8 @@ impl<T> [T] { /// // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 /// // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed /// ``` - #[stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_as_chunks", since = "1.88.0")] + #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] #[inline] #[must_use] pub const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]] { @@ -1551,8 +1551,8 @@ impl<T> [T] { /// } /// assert_eq!(v, &[1, 1, 2, 2, 9]); /// ``` - #[stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_as_chunks", since = "1.88.0")] + #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] #[inline] #[track_caller] #[must_use] @@ -1604,8 +1604,8 @@ impl<T> [T] { /// } /// assert_eq!(v, &[9, 1, 1, 2, 2]); /// ``` - #[stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "slice_as_chunks", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "slice_as_chunks", since = "1.88.0")] + #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] #[inline] #[track_caller] #[must_use] diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index dafabba645c..9e7e949b722 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -134,7 +134,7 @@ impl str { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_str_len", since = "1.39.0")] #[rustc_diagnostic_item = "str_len"] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[must_use] #[inline] pub const fn len(&self) -> usize { @@ -154,7 +154,7 @@ impl str { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_str_is_empty", since = "1.39.0")] - #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)] + #[rustc_no_implicit_autorefs] #[must_use] #[inline] pub const fn is_empty(&self) -> bool { | 
