replace version placeholder

This commit is contained in:
Pietro Albini 2024-06-10 14:50:54 +02:00
parent 534b5855a6
commit be9e27e490
No known key found for this signature in database
GPG Key ID: CD76B35F7734769E
24 changed files with 119 additions and 122 deletions

View File

@ -139,7 +139,7 @@ macro_rules! declare_features {
/// Allows `crate` in paths.
(accepted, crate_in_paths, "1.30.0", Some(45477)),
/// Allows users to provide classes for fenced code block using `class:classname`.
(accepted, custom_code_classes_in_docs, "CURRENT_RUSTC_VERSION", Some(79483)),
(accepted, custom_code_classes_in_docs, "1.80.0", Some(79483)),
/// Allows using `#[debugger_visualizer]` attribute.
(accepted, debugger_visualizer, "1.71.0", Some(95939)),
/// Allows rustc to inject a default alloc_error_handler
@ -165,7 +165,7 @@ macro_rules! declare_features {
/// Allows using `dyn Trait` as a syntax for trait objects.
(accepted, dyn_trait, "1.27.0", Some(44662)),
/// Allows `X..Y` patterns.
(accepted, exclusive_range_pattern, "CURRENT_RUSTC_VERSION", Some(37854)),
(accepted, exclusive_range_pattern, "1.80.0", Some(37854)),
/// Allows integer match exhaustiveness checking (RFC 2591).
(accepted, exhaustive_integer_patterns, "1.33.0", Some(50907)),
/// Allows explicit generic arguments specification with `impl Trait` present.

View File

@ -457,7 +457,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows explicit tail calls via `become` expression.
(incomplete, explicit_tail_calls, "1.72.0", Some(112788)),
/// Uses 2024 rules for matching `expr` fragments in macros. Also enables `expr_2021` fragment.
(incomplete, expr_fragment_specifier_2024, "CURRENT_RUSTC_VERSION", Some(123742)),
(incomplete, expr_fragment_specifier_2024, "1.80.0", Some(123742)),
/// Allows using `efiapi`, `sysv64` and `win64` as calling convention
/// for functions with varargs.
(unstable, extended_varargs_abi_support, "1.65.0", Some(100189)),
@ -488,7 +488,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows generic parameters and where-clauses on free & associated const items.
(incomplete, generic_const_items, "1.73.0", Some(113521)),
/// Allows registering static items globally, possibly across crates, to iterate over at runtime.
(unstable, global_registration, "CURRENT_RUSTC_VERSION", Some(125119)),
(unstable, global_registration, "1.80.0", Some(125119)),
/// Allows using `..=X` as a patterns in slices.
(unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)),
/// Allows `if let` guard in match arms.
@ -581,7 +581,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
(unstable, repr_simd, "1.4.0", Some(27731)),
/// Allows enums like Result<T, E> to be used across FFI, if T's niche value can
/// be used to describe E or vise-versa.
(unstable, result_ffi_guarantees, "CURRENT_RUSTC_VERSION", Some(110503)),
(unstable, result_ffi_guarantees, "1.80.0", Some(110503)),
/// Allows bounding the return type of AFIT/RPITIT.
(incomplete, return_type_notation, "1.70.0", Some(109417)),
/// Allows `extern "rust-cold"`.
@ -623,9 +623,9 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows unnamed fields of struct and union type
(incomplete, unnamed_fields, "1.74.0", Some(49804)),
/// Allows unsafe attributes.
(unstable, unsafe_attributes, "CURRENT_RUSTC_VERSION", Some(123757)),
(unstable, unsafe_attributes, "1.80.0", Some(123757)),
/// Allows unsafe on extern declarations and safety qualifiers over internal items.
(unstable, unsafe_extern_blocks, "CURRENT_RUSTC_VERSION", Some(123743)),
(unstable, unsafe_extern_blocks, "1.80.0", Some(123743)),
/// Allows unsized fn parameters.
(unstable, unsized_fn_params, "1.49.0", Some(48055)),
/// Allows unsized rvalues at arguments and parameters.

View File

@ -49,10 +49,10 @@
///
/// ### Explanation
///
/// Since Rust CURRENT_RUSTC_VERSION, boxed slices implement `IntoIterator`. However, to avoid
/// Since Rust 1.80.0, boxed slices implement `IntoIterator`. However, to avoid
/// breakage, `boxed_slice.into_iter()` in Rust 2015, 2018, and 2021 code will still
/// behave as `(&boxed_slice).into_iter()`, returning an iterator over
/// references, just like in Rust CURRENT_RUSTC_VERSION and earlier.
/// references, just like in Rust 1.80.0 and earlier.
/// This only applies to the method call syntax `boxed_slice.into_iter()`, not to
/// any other syntax such as `for _ in boxed_slice` or `IntoIterator::into_iter(boxed_slice)`.
pub BOXED_SLICE_INTO_ITER,

View File

@ -2123,23 +2123,23 @@ fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self {
/// This implementation is required to make sure that the `Box<[I]>: IntoIterator`
/// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<I, A: Allocator> !Iterator for Box<[I], A> {}
/// This implementation is required to make sure that the `&Box<[I]>: IntoIterator`
/// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> !Iterator for &'a Box<[I], A> {}
/// This implementation is required to make sure that the `&mut Box<[I]>: IntoIterator`
/// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> !Iterator for &'a mut Box<[I], A> {}
// Note: the `#[rustc_skip_during_method_dispatch(boxed_slice)]` on `trait IntoIterator`
// hides this implementation from explicit `.into_iter()` calls on editions < 2024,
// so those calls will still resolve to the slice implementation, by reference.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<I, A: Allocator> IntoIterator for Box<[I], A> {
type IntoIter = vec::IntoIter<I, A>;
type Item = I;
@ -2148,7 +2148,7 @@ fn into_iter(self) -> vec::IntoIter<I, A> {
}
}
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> IntoIterator for &'a Box<[I], A> {
type IntoIter = slice::Iter<'a, I>;
type Item = &'a I;
@ -2157,7 +2157,7 @@ fn into_iter(self) -> slice::Iter<'a, I> {
}
}
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> IntoIterator for &'a mut Box<[I], A> {
type IntoIter = slice::IterMut<'a, I>;
type Item = &'a mut I;
@ -2167,7 +2167,7 @@ fn into_iter(self) -> slice::IterMut<'a, I> {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl FromIterator<char> for Box<str> {
fn from_iter<T: IntoIterator<Item = char>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
@ -2175,7 +2175,7 @@ fn from_iter<T: IntoIterator<Item = char>>(iter: T) -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<'a> FromIterator<&'a char> for Box<str> {
fn from_iter<T: IntoIterator<Item = &'a char>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
@ -2183,7 +2183,7 @@ fn from_iter<T: IntoIterator<Item = &'a char>>(iter: T) -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<'a> FromIterator<&'a str> for Box<str> {
fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
@ -2191,7 +2191,7 @@ fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl FromIterator<String> for Box<str> {
fn from_iter<T: IntoIterator<Item = String>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
@ -2199,7 +2199,7 @@ fn from_iter<T: IntoIterator<Item = String>>(iter: T) -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<A: Allocator> FromIterator<Box<str, A>> for Box<str> {
fn from_iter<T: IntoIterator<Item = Box<str, A>>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
@ -2207,7 +2207,7 @@ fn from_iter<T: IntoIterator<Item = Box<str, A>>>(iter: T) -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<'a> FromIterator<Cow<'a, str>> for Box<str> {
fn from_iter<T: IntoIterator<Item = Cow<'a, str>>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()

View File

@ -440,10 +440,7 @@ impl<T: Ord> BinaryHeap<T> {
/// heap.push(4);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(
feature = "const_binary_heap_constructor",
since = "CURRENT_RUSTC_VERSION"
)]
#[rustc_const_stable(feature = "const_binary_heap_constructor", since = "1.80.0")]
#[must_use]
pub const fn new() -> BinaryHeap<T> {
BinaryHeap { data: vec![] }
@ -1224,7 +1221,7 @@ pub fn shrink_to(&mut self, min_capacity: usize) {
/// io::sink().write(heap.as_slice()).unwrap();
/// ```
#[must_use]
#[stable(feature = "binary_heap_as_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "binary_heap_as_slice", since = "1.80.0")]
pub fn as_slice(&self) -> &[T] {
self.data.as_slice()
}

View File

@ -911,7 +911,7 @@ fn from(s: &CStr) -> Rc<CStr> {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Rc<CStr> {
/// Creates an empty CStr inside an Rc
///

View File

@ -2250,7 +2250,7 @@ fn default() -> Rc<T> {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Rc<str> {
/// Creates an empty str inside an Rc
///
@ -2262,7 +2262,7 @@ fn default() -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl<T> Default for Rc<[T]> {
/// Creates an empty `[T]` inside an Rc
///

View File

@ -3405,7 +3405,7 @@ struct SliceArcInnerForStatic {
};
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Arc<str> {
/// Creates an empty str inside an Arc
///
@ -3420,7 +3420,7 @@ fn default() -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Arc<core::ffi::CStr> {
/// Creates an empty CStr inside an Arc
///
@ -3439,7 +3439,7 @@ fn default() -> Self {
}
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl<T> Default for Arc<[T]> {
/// Creates an empty `[T]` inside an Arc
///

View File

@ -2649,7 +2649,7 @@ pub fn extend_from_within<R>(&mut self, src: R)
/// let mut flattened = vec.into_flattened();
/// assert_eq!(flattened.pop(), Some(6));
/// ```
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "slice_flatten", since = "1.80.0")]
pub fn into_flattened(self) -> Vec<T, A> {
let (ptr, len, cap, alloc) = self.into_raw_parts_with_alloc();
let (new_len, new_cap) = if T::IS_ZST {

View File

@ -260,7 +260,7 @@
mod lazy;
mod once;
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub use lazy::LazyCell;
#[stable(feature = "once_cell", since = "1.70.0")]
pub use once::OnceCell;

View File

@ -34,7 +34,7 @@ enum State<T, F> {
/// // 92
/// // 92
/// ```
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub struct LazyCell<T, F = fn() -> T> {
state: UnsafeCell<State<T, F>>,
}
@ -54,8 +54,8 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// assert_eq!(&*lazy, "HELLO, WORLD!");
/// ```
#[inline]
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
#[rustc_const_stable(feature = "lazy_cell", since = "1.80.0")]
pub const fn new(f: F) -> LazyCell<T, F> {
LazyCell { state: UnsafeCell::new(State::Uninit(f)) }
}
@ -103,7 +103,7 @@ pub fn into_inner(this: Self) -> Result<T, F> {
/// assert_eq!(&*lazy, &92);
/// ```
#[inline]
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub fn force(this: &LazyCell<T, F>) -> &T {
// SAFETY:
// This invalidates any mutable references to the data. The resulting
@ -167,7 +167,7 @@ fn get(&self) -> Option<&T> {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T, F: FnOnce() -> T> Deref for LazyCell<T, F> {
type Target = T;
#[inline]
@ -176,7 +176,7 @@ fn deref(&self) -> &T {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: Default> Default for LazyCell<T> {
/// Creates a new lazy value using `Default` as the initializing function.
#[inline]
@ -185,7 +185,7 @@ fn default() -> LazyCell<T> {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: fmt::Debug, F> fmt::Debug for LazyCell<T, F> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = f.debug_tuple("LazyCell");

View File

@ -464,7 +464,7 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
///
/// assert_eq!(Ipv4Addr::BITS, 32);
/// ```
#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "ip_bits", since = "1.80.0")]
pub const BITS: u32 = 32;
/// Converts an IPv4 address into a `u32` representation using native byte order.
@ -492,8 +492,8 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x00), Ipv4Addr::from_bits(addr_bits));
///
/// ```
#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ip_bits", since = "1.80.0")]
#[stable(feature = "ip_bits", since = "1.80.0")]
#[must_use]
#[inline]
pub const fn to_bits(self) -> u32 {
@ -512,8 +512,8 @@ pub const fn to_bits(self) -> u32 {
/// let addr = Ipv4Addr::from(0x12345678);
/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);
/// ```
#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ip_bits", since = "1.80.0")]
#[stable(feature = "ip_bits", since = "1.80.0")]
#[must_use]
#[inline]
pub const fn from_bits(bits: u32) -> Ipv4Addr {
@ -1238,7 +1238,7 @@ pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16)
///
/// assert_eq!(Ipv6Addr::BITS, 128);
/// ```
#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "ip_bits", since = "1.80.0")]
pub const BITS: u32 = 128;
/// Converts an IPv6 address into a `u128` representation using native byte order.
@ -1277,8 +1277,8 @@ pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16)
/// Ipv6Addr::from_bits(addr_bits));
///
/// ```
#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ip_bits", since = "1.80.0")]
#[stable(feature = "ip_bits", since = "1.80.0")]
#[must_use]
#[inline]
pub const fn to_bits(self) -> u128 {
@ -1302,8 +1302,8 @@ pub const fn to_bits(self) -> u128 {
/// ),
/// addr);
/// ```
#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ip_bits", since = "1.80.0")]
#[stable(feature = "ip_bits", since = "1.80.0")]
#[must_use]
#[inline]
pub const fn from_bits(bits: u128) -> Ipv6Addr {

View File

@ -1724,7 +1724,7 @@ pub const fn take(&mut self) -> Option<T> {
/// assert_eq!(prev, Some(43));
/// ```
#[inline]
#[stable(feature = "option_take_if", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "option_take_if", since = "1.80.0")]
pub fn take_if<P>(&mut self, predicate: P) -> Option<T>
where
P: FnOnce(&mut T) -> bool,

View File

@ -14,7 +14,7 @@
#[stable(feature = "core_prelude", since = "1.4.0")]
#[doc(no_inline)]
pub use crate::mem::drop;
#[stable(feature = "size_of_prelude", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "size_of_prelude", since = "1.80.0")]
#[doc(no_inline)]
pub use crate::mem::{align_of, align_of_val, size_of, size_of_val};

View File

@ -525,8 +525,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[must_use = "returns a new pointer rather than modifying its argument"]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn offset(self, count: isize) -> Self
where
T: Sized,
@ -551,8 +551,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
#[must_use]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn byte_offset(self, count: isize) -> Self {
// SAFETY: the caller must uphold the safety contract for `offset` and `byte_offset` has
// the same safety contract.
@ -611,8 +611,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[must_use = "returns a new pointer rather than modifying its argument"]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn add(self, count: usize) -> Self
where
T: Sized,
@ -638,8 +638,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[rustc_allow_const_fn_unstable(set_ptr_value)]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn byte_add(self, count: usize) -> Self {
// SAFETY: the caller must uphold the safety contract for `add` and `byte_add` has the same
// safety contract.
@ -699,8 +699,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[must_use = "returns a new pointer rather than modifying its argument"]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_allow_const_fn_unstable(unchecked_neg)]
pub const unsafe fn sub(self, count: usize) -> Self
where
@ -732,8 +732,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[rustc_allow_const_fn_unstable(set_ptr_value)]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn byte_sub(self, count: usize) -> Self {
// SAFETY: the caller must uphold the safety contract for `sub` and `byte_sub` has the same
// safety contract.
@ -847,8 +847,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
/// ```
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn offset_from(self, origin: NonNull<T>) -> isize
where
T: Sized,
@ -868,8 +868,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
/// ignoring the metadata.
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn byte_offset_from<U: ?Sized>(self, origin: NonNull<U>) -> isize {
// SAFETY: the caller must uphold the safety contract for `byte_offset_from`.
unsafe { self.pointer.byte_offset_from(origin.pointer) }
@ -958,8 +958,8 @@ pub const fn cast<U>(self) -> NonNull<U> {
/// [`ptr::read`]: crate::ptr::read()
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn read(self) -> T
where
T: Sized,
@ -980,7 +980,7 @@ pub const fn cast<U>(self) -> NonNull<U> {
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
pub unsafe fn read_volatile(self) -> T
where
T: Sized,
@ -999,8 +999,8 @@ pub unsafe fn read_volatile(self) -> T
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
pub const unsafe fn read_unaligned(self) -> T
where
T: Sized,
@ -1019,7 +1019,7 @@ pub unsafe fn read_volatile(self) -> T
/// [`ptr::copy`]: crate::ptr::copy()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize)
where
@ -1039,7 +1039,7 @@ pub unsafe fn read_volatile(self) -> T
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize)
where
@ -1059,7 +1059,7 @@ pub unsafe fn read_volatile(self) -> T
/// [`ptr::copy`]: crate::ptr::copy()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize)
where
@ -1079,7 +1079,7 @@ pub unsafe fn read_volatile(self) -> T
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize)
where
@ -1095,7 +1095,7 @@ pub unsafe fn read_volatile(self) -> T
///
/// [`ptr::drop_in_place`]: crate::ptr::drop_in_place()
#[inline(always)]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
pub unsafe fn drop_in_place(self) {
// SAFETY: the caller must uphold the safety contract for `drop_in_place`.
unsafe { ptr::drop_in_place(self.as_ptr()) }
@ -1109,7 +1109,7 @@ pub unsafe fn drop_in_place(self) {
/// [`ptr::write`]: crate::ptr::write()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
pub const unsafe fn write(self, val: T)
where
@ -1128,7 +1128,7 @@ pub unsafe fn drop_in_place(self) {
#[inline(always)]
#[doc(alias = "memset")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
pub const unsafe fn write_bytes(self, val: u8, count: usize)
where
@ -1150,7 +1150,7 @@ pub unsafe fn drop_in_place(self) {
/// [`ptr::write_volatile`]: crate::ptr::write_volatile()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
pub unsafe fn write_volatile(self, val: T)
where
T: Sized,
@ -1169,7 +1169,7 @@ pub unsafe fn write_volatile(self, val: T)
/// [`ptr::write_unaligned`]: crate::ptr::write_unaligned()
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
pub const unsafe fn write_unaligned(self, val: T)
where
@ -1186,7 +1186,7 @@ pub unsafe fn write_volatile(self, val: T)
///
/// [`ptr::replace`]: crate::ptr::replace()
#[inline(always)]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
pub unsafe fn replace(self, src: T) -> T
where
T: Sized,
@ -1203,7 +1203,7 @@ pub unsafe fn replace(self, src: T) -> T
///
/// [`ptr::swap`]: crate::ptr::swap()
#[inline(always)]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_swap", issue = "83163")]
pub const unsafe fn swap(self, with: NonNull<T>)
where
@ -1255,7 +1255,7 @@ pub unsafe fn replace(self, src: T) -> T
/// ```
#[inline]
#[must_use]
#[stable(feature = "non_null_convenience", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_align_offset", issue = "90962")]
pub const fn align_offset(self, align: usize) -> usize
where

View File

@ -123,8 +123,8 @@ pub fn escape_ascii(&self) -> EscapeAscii<'_> {
/// assert_eq!(b" ".trim_ascii_start(), b"");
/// assert_eq!(b"".trim_ascii_start(), b"");
/// ```
#[stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[inline]
pub const fn trim_ascii_start(&self) -> &[u8] {
let mut bytes = self;
@ -152,8 +152,8 @@ pub const fn trim_ascii_start(&self) -> &[u8] {
/// assert_eq!(b" ".trim_ascii_end(), b"");
/// assert_eq!(b"".trim_ascii_end(), b"");
/// ```
#[stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[inline]
pub const fn trim_ascii_end(&self) -> &[u8] {
let mut bytes = self;
@ -182,8 +182,8 @@ pub const fn trim_ascii_end(&self) -> &[u8] {
/// assert_eq!(b" ".trim_ascii(), b"");
/// assert_eq!(b"".trim_ascii(), b"");
/// ```
#[stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[inline]
pub const fn trim_ascii(&self) -> &[u8] {
self.trim_ascii_start().trim_ascii_end()

View File

@ -16,7 +16,7 @@
use super::{from_raw_parts, from_raw_parts_mut};
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<T> !Iterator for [T] {}
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -2082,8 +2082,8 @@ pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
///
/// assert_eq!(None, v.split_at_checked(7));
/// ```
#[stable(feature = "split_at_checked", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "split_at_checked", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "split_at_checked", since = "1.80.0")]
#[rustc_const_stable(feature = "split_at_checked", since = "1.80.0")]
#[inline]
#[must_use]
pub const fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])> {
@ -2121,7 +2121,7 @@ pub const fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])> {
///
/// assert_eq!(None, v.split_at_mut_checked(7));
/// ```
#[stable(feature = "split_at_checked", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "split_at_checked", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_slice_split_at_mut", issue = "101804")]
#[inline]
#[must_use]
@ -4544,7 +4544,7 @@ pub fn get_many_mut<const N: usize>(
/// let empty_slice_of_arrays: &[[u32; 10]] = &[];
/// assert!(empty_slice_of_arrays.as_flattened().is_empty());
/// ```
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "slice_flatten", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_slice_flatten", issue = "95629")]
pub const fn as_flattened(&self) -> &[T] {
let len = if T::IS_ZST {
@ -4581,7 +4581,7 @@ pub const fn as_flattened(&self) -> &[T] {
/// add_5_to_all(array.as_flattened_mut());
/// assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
/// ```
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "slice_flatten", since = "1.80.0")]
pub fn as_flattened_mut(&mut self) -> &mut [T] {
let len = if T::IS_ZST {
self.len().checked_mul(N).expect("slice len overflow")

View File

@ -732,7 +732,7 @@ pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) {
/// ```
#[inline]
#[must_use]
#[stable(feature = "split_at_checked", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "split_at_checked", since = "1.80.0")]
pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)> {
// is_char_boundary checks that the index is in [0, .len()]
if self.is_char_boundary(mid) {
@ -772,7 +772,7 @@ pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)> {
/// ```
#[inline]
#[must_use]
#[stable(feature = "split_at_checked", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "split_at_checked", since = "1.80.0")]
pub fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut str, &mut str)> {
// is_char_boundary checks that the index is in [0, .len()]
if self.is_char_boundary(mid) {
@ -2546,8 +2546,8 @@ pub fn make_ascii_lowercase(&mut self) {
/// ```
#[must_use = "this returns the trimmed string as a new slice, \
without modifying the original"]
#[stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[inline]
pub const fn trim_ascii_start(&self) -> &str {
// SAFETY: Removing ASCII characters from a `&str` does not invalidate
@ -2571,8 +2571,8 @@ pub const fn trim_ascii_start(&self) -> &str {
/// ```
#[must_use = "this returns the trimmed string as a new slice, \
without modifying the original"]
#[stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[inline]
pub const fn trim_ascii_end(&self) -> &str {
// SAFETY: Removing ASCII characters from a `&str` does not invalidate
@ -2597,8 +2597,8 @@ pub const fn trim_ascii_end(&self) -> &str {
/// ```
#[must_use = "this returns the trimmed string as a new slice, \
without modifying the original"]
#[stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[rustc_const_stable(feature = "byte_slice_trim_ascii", since = "1.80.0")]
#[inline]
pub const fn trim_ascii(&self) -> &str {
// SAFETY: Removing ASCII characters from a `&str` does not invalidate

View File

@ -1090,7 +1090,7 @@ pub fn div_f32(self, rhs: f32) -> Duration {
/// let dur2 = Duration::new(5, 400_000_000);
/// assert_eq!(dur1.div_duration_f64(dur2), 0.5);
/// ```
#[stable(feature = "div_duration", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "div_duration", since = "1.80.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@ -1111,7 +1111,7 @@ pub const fn div_duration_f64(self, rhs: Duration) -> f64 {
/// let dur2 = Duration::new(5, 400_000_000);
/// assert_eq!(dur1.div_duration_f32(dur2), 0.5);
/// ```
#[stable(feature = "div_duration", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "div_duration", since = "1.80.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]

View File

@ -2058,7 +2058,7 @@ fn stream_position(&mut self) -> Result<u64> {
/// ```
///
/// [`BufReader`]: crate::io::BufReader
#[stable(feature = "seek_seek_relative", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "seek_seek_relative", since = "1.80.0")]
fn seek_relative(&mut self, offset: i64) -> Result<()> {
self.seek(SeekFrom::Current(offset))?;
Ok(())

View File

@ -14,7 +14,7 @@
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::mem::drop;
#[stable(feature = "size_of_prelude", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "size_of_prelude", since = "1.80.0")]
#[doc(no_inline)]
pub use crate::mem::{align_of, align_of_val, size_of, size_of_val};

View File

@ -64,7 +64,7 @@ union Data<T, F> {
/// println!("{}", *data.number);
/// }
/// ```
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub struct LazyLock<T, F = fn() -> T> {
once: Once,
data: UnsafeCell<Data<T, F>>,
@ -85,8 +85,8 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
/// assert_eq!(&*lazy, "HELLO, WORLD!");
/// ```
#[inline]
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
#[rustc_const_stable(feature = "lazy_cell", since = "1.80.0")]
pub const fn new(f: F) -> LazyLock<T, F> {
LazyLock { once: Once::new(), data: UnsafeCell::new(Data { f: ManuallyDrop::new(f) }) }
}
@ -152,7 +152,7 @@ pub fn into_inner(mut this: Self) -> Result<T, F> {
/// assert_eq!(&*lazy, &92);
/// ```
#[inline]
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub fn force(this: &LazyLock<T, F>) -> &T {
this.once.call_once(|| {
// SAFETY: `call_once` only runs this closure once, ever.
@ -188,7 +188,7 @@ fn get(&self) -> Option<&T> {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T, F> Drop for LazyLock<T, F> {
fn drop(&mut self) {
match self.once.state() {
@ -201,7 +201,7 @@ fn drop(&mut self) {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T, F: FnOnce() -> T> Deref for LazyLock<T, F> {
type Target = T;
@ -216,7 +216,7 @@ fn deref(&self) -> &T {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: Default> Default for LazyLock<T> {
/// Creates a new lazy value using `Default` as the initializing function.
#[inline]
@ -225,7 +225,7 @@ fn default() -> LazyLock<T> {
}
}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: fmt::Debug, F> fmt::Debug for LazyLock<T, F> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = f.debug_tuple("LazyLock");
@ -239,13 +239,13 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// We never create a `&F` from a `&LazyLock<T, F>` so it is fine
// to not impl `Sync` for `F`.
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
unsafe impl<T: Sync + Send, F: Send> Sync for LazyLock<T, F> {}
// auto-derived `Send` impl is OK.
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: RefUnwindSafe + UnwindSafe, F: UnwindSafe> RefUnwindSafe for LazyLock<T, F> {}
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: UnwindSafe, F: UnwindSafe> UnwindSafe for LazyLock<T, F> {}
#[cfg(test)]

View File

@ -182,7 +182,7 @@
#[stable(feature = "rust1", since = "1.0.0")]
pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub use self::lazy_lock::LazyLock;
#[stable(feature = "once_cell", since = "1.70.0")]
pub use self::once_lock::OnceLock;