diff options
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/io/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/io/stdio.rs | 6 | ||||
| -rw-r--r-- | library/std/src/os/android/net.rs | 4 | ||||
| -rw-r--r-- | library/std/src/os/fd/owned.rs | 2 | ||||
| -rw-r--r-- | library/std/src/os/linux/net.rs | 4 | ||||
| -rw-r--r-- | library/std/src/os/net/linux_ext/addr.rs | 6 | ||||
| -rw-r--r-- | library/std/src/os/net/linux_ext/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/os/unix/net/addr.rs | 4 | ||||
| -rw-r--r-- | library/std/src/os/unix/net/datagram.rs | 6 | ||||
| -rw-r--r-- | library/std/src/os/unix/net/listener.rs | 2 | ||||
| -rw-r--r-- | library/std/src/os/unix/net/stream.rs | 2 | ||||
| -rw-r--r-- | library/std/src/os/windows/io/handle.rs | 2 | ||||
| -rw-r--r-- | library/std/src/path.rs | 4 | ||||
| -rw-r--r-- | library/std/src/primitive_docs.rs | 75 | ||||
| -rw-r--r-- | library/std/src/sync/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sync/once_lock.rs | 40 | ||||
| -rw-r--r-- | library/std/src/sys/common/thread_local/fast_local.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/common/thread_local/os_local.rs | 2 |
18 files changed, 72 insertions, 97 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 4cd7885bd4a..9e09ce337bc 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -268,7 +268,7 @@ pub(crate) use self::stdio::attempt_print_to_stderr; #[unstable(feature = "internal_output_capture", issue = "none")] #[doc(no_inline, hidden)] pub use self::stdio::set_output_capture; -#[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "is_terminal", since = "1.70.0")] pub use self::stdio::IsTerminal; #[unstable(feature = "print_internals", issue = "none")] pub use self::stdio::{_eprint, _print}; diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index b2c57b8ddc7..9098d36ee53 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -1047,7 +1047,7 @@ pub(crate) fn attempt_print_to_stderr(args: fmt::Arguments<'_>) { } /// Trait to determine if a descriptor/handle refers to a terminal/tty. -#[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "is_terminal", since = "1.70.0")] pub trait IsTerminal: crate::sealed::Sealed { /// Returns `true` if the descriptor/handle refers to a terminal/tty. /// @@ -1063,7 +1063,7 @@ pub trait IsTerminal: crate::sealed::Sealed { /// Note that this [may change in the future][changes]. /// /// [changes]: io#platform-specific-behavior - #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_terminal", since = "1.70.0")] fn is_terminal(&self) -> bool; } @@ -1072,7 +1072,7 @@ macro_rules! impl_is_terminal { #[unstable(feature = "sealed", issue = "none")] impl crate::sealed::Sealed for $t {} - #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_terminal", since = "1.70.0")] impl IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { diff --git a/library/std/src/os/android/net.rs b/library/std/src/os/android/net.rs index 4e88ab8ff5c..fe40d6319c2 100644 --- a/library/std/src/os/android/net.rs +++ b/library/std/src/os/android/net.rs @@ -1,8 +1,8 @@ //! Android-specific networking functionality. -#![stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#![stable(feature = "unix_socket_abstract", since = "1.70.0")] -#[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub use crate::os::net::linux_ext::addr::SocketAddrExt; #[unstable(feature = "tcp_quickack", issue = "96256")] diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs index 6a6e6f33158..2180d2974d5 100644 --- a/library/std/src/os/fd/owned.rs +++ b/library/std/src/os/fd/owned.rs @@ -201,7 +201,7 @@ macro_rules! impl_is_terminal { #[unstable(feature = "sealed", issue = "none")] impl crate::sealed::Sealed for $t {} - #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_terminal", since = "1.70.0")] impl crate::io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { diff --git a/library/std/src/os/linux/net.rs b/library/std/src/os/linux/net.rs index fcb3bb83485..c8e734d740b 100644 --- a/library/std/src/os/linux/net.rs +++ b/library/std/src/os/linux/net.rs @@ -1,8 +1,8 @@ //! Linux-specific networking functionality. -#![stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#![stable(feature = "unix_socket_abstract", since = "1.70.0")] -#[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub use crate::os::net::linux_ext::addr::SocketAddrExt; #[unstable(feature = "tcp_quickack", issue = "96256")] diff --git a/library/std/src/os/net/linux_ext/addr.rs b/library/std/src/os/net/linux_ext/addr.rs index ea8102c9cc0..aed772056e1 100644 --- a/library/std/src/os/net/linux_ext/addr.rs +++ b/library/std/src/os/net/linux_ext/addr.rs @@ -4,7 +4,7 @@ use crate::os::unix::net::SocketAddr; use crate::sealed::Sealed; /// Platform-specific extensions to [`SocketAddr`]. -#[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub trait SocketAddrExt: Sealed { /// Creates a Unix socket address in the abstract namespace. /// @@ -37,7 +37,7 @@ pub trait SocketAddrExt: Sealed { /// Ok(()) /// } /// ``` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] fn from_abstract_name<N>(name: N) -> crate::io::Result<SocketAddr> where N: AsRef<[u8]>; @@ -59,6 +59,6 @@ pub trait SocketAddrExt: Sealed { /// Ok(()) /// } /// ``` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] fn as_abstract_name(&self) -> Option<&[u8]>; } diff --git a/library/std/src/os/net/linux_ext/mod.rs b/library/std/src/os/net/linux_ext/mod.rs index e7423dce613..62e78cc50d4 100644 --- a/library/std/src/os/net/linux_ext/mod.rs +++ b/library/std/src/os/net/linux_ext/mod.rs @@ -2,7 +2,7 @@ #![doc(cfg(any(target_os = "linux", target_os = "android")))] -#[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub(crate) mod addr; #[unstable(feature = "tcp_quickack", issue = "96256")] diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs index 52a0da5bf1a..6c99e8c3620 100644 --- a/library/std/src/os/unix/net/addr.rs +++ b/library/std/src/os/unix/net/addr.rs @@ -245,12 +245,12 @@ impl SocketAddr { } } -#[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "unix_socket_abstract", since = "1.70.0")] impl Sealed for SocketAddr {} #[doc(cfg(any(target_os = "android", target_os = "linux")))] #[cfg(any(doc, target_os = "android", target_os = "linux"))] -#[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "unix_socket_abstract", since = "1.70.0")] impl linux_ext::addr::SocketAddrExt for SocketAddr { fn as_abstract_name(&self) -> Option<&[u8]> { if let AddressKind::Abstract(name) = self.address() { Some(name) } else { None } diff --git a/library/std/src/os/unix/net/datagram.rs b/library/std/src/os/unix/net/datagram.rs index 41cdcda4613..34db54235f1 100644 --- a/library/std/src/os/unix/net/datagram.rs +++ b/library/std/src/os/unix/net/datagram.rs @@ -118,7 +118,7 @@ impl UnixDatagram { /// Ok(()) /// } /// ``` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub fn bind_addr(socket_addr: &SocketAddr) -> io::Result<UnixDatagram> { unsafe { let socket = UnixDatagram::unbound()?; @@ -233,7 +233,7 @@ impl UnixDatagram { /// Ok(()) /// } /// ``` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub fn connect_addr(&self, socket_addr: &SocketAddr) -> io::Result<()> { unsafe { cvt(libc::connect( @@ -532,7 +532,7 @@ impl UnixDatagram { /// Ok(()) /// } /// ``` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub fn send_to_addr(&self, buf: &[u8], socket_addr: &SocketAddr) -> io::Result<usize> { unsafe { let count = cvt(libc::sendto( diff --git a/library/std/src/os/unix/net/listener.rs b/library/std/src/os/unix/net/listener.rs index 83f0debe676..5be8aebc70f 100644 --- a/library/std/src/os/unix/net/listener.rs +++ b/library/std/src/os/unix/net/listener.rs @@ -106,7 +106,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub fn bind_addr(socket_addr: &SocketAddr) -> io::Result<UnixListener> { unsafe { let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?; diff --git a/library/std/src/os/unix/net/stream.rs b/library/std/src/os/unix/net/stream.rs index 5aa3fb92576..bf2a51b5edb 100644 --- a/library/std/src/os/unix/net/stream.rs +++ b/library/std/src/os/unix/net/stream.rs @@ -122,7 +122,7 @@ impl UnixStream { /// Ok(()) /// } /// ```` - #[stable(feature = "unix_socket_abstract", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "unix_socket_abstract", since = "1.70.0")] pub fn connect_addr(socket_addr: &SocketAddr) -> io::Result<UnixStream> { unsafe { let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?; diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs index 11948cecad8..9b77cd8321b 100644 --- a/library/std/src/os/windows/io/handle.rs +++ b/library/std/src/os/windows/io/handle.rs @@ -389,7 +389,7 @@ macro_rules! impl_is_terminal { #[unstable(feature = "sealed", issue = "none")] impl crate::sealed::Sealed for $t {} - #[stable(feature = "is_terminal", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "is_terminal", since = "1.70.0")] impl crate::io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { diff --git a/library/std/src/path.rs b/library/std/src/path.rs index e5abd02a1bc..5b22333cc35 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1509,7 +1509,7 @@ impl PathBuf { /// path.as_mut_os_string().push("baz"); /// assert_eq!(path, Path::new("/foo/barbaz")); /// ``` - #[stable(feature = "path_as_mut_os_str", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "path_as_mut_os_str", since = "1.70.0")] #[must_use] #[inline] pub fn as_mut_os_string(&mut self) -> &mut OsString { @@ -2074,7 +2074,7 @@ impl Path { /// path.as_mut_os_str().make_ascii_lowercase(); /// assert_eq!(path, Path::new("foo.txt")); /// ``` - #[stable(feature = "path_as_mut_os_str", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "path_as_mut_os_str", since = "1.70.0")] #[must_use] #[inline] pub fn as_mut_os_str(&mut self) -> &mut OsStr { diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 3df990e5dd9..08ffc407ead 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -1,8 +1,7 @@ // `library/{std,core}/src/primitive_docs.rs` should have the same contents. // These are different files so that relative links work properly without // having to have `CARGO_PKG_NAME` set, but conceptually they should always be the same. -#[cfg_attr(bootstrap, doc(primitive = "bool"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "bool")] +#[rustc_doc_primitive = "bool"] #[doc(alias = "true")] #[doc(alias = "false")] /// The boolean type. @@ -64,8 +63,7 @@ #[stable(feature = "rust1", since = "1.0.0")] mod prim_bool {} -#[cfg_attr(bootstrap, doc(primitive = "never"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "never")] +#[rustc_doc_primitive = "never"] #[doc(alias = "!")] // /// The `!` type, also called "never". @@ -276,8 +274,7 @@ mod prim_bool {} #[unstable(feature = "never_type", issue = "35121")] mod prim_never {} -#[cfg_attr(bootstrap, doc(primitive = "char"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "char")] +#[rustc_doc_primitive = "char"] #[allow(rustdoc::invalid_rust_codeblocks)] /// A character type. /// @@ -401,8 +398,7 @@ mod prim_never {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_char {} -#[cfg_attr(bootstrap, doc(primitive = "unit"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "unit")] +#[rustc_doc_primitive = "unit"] #[doc(alias = "(")] #[doc(alias = ")")] #[doc(alias = "()")] @@ -464,8 +460,7 @@ impl Copy for () { // empty } -#[cfg_attr(bootstrap, doc(primitive = "pointer"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "pointer")] +#[rustc_doc_primitive = "pointer"] #[doc(alias = "ptr")] #[doc(alias = "*")] #[doc(alias = "*const")] @@ -581,8 +576,7 @@ impl Copy for () { #[stable(feature = "rust1", since = "1.0.0")] mod prim_pointer {} -#[cfg_attr(bootstrap, doc(primitive = "array"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "array")] +#[rustc_doc_primitive = "array"] #[doc(alias = "[]")] #[doc(alias = "[T;N]")] // unfortunately, rustdoc doesn't have fuzzy search for aliases #[doc(alias = "[T; N]")] @@ -783,8 +777,7 @@ mod prim_pointer {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_array {} -#[cfg_attr(bootstrap, doc(primitive = "slice"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "slice")] +#[rustc_doc_primitive = "slice"] #[doc(alias = "[")] #[doc(alias = "]")] #[doc(alias = "[]")] @@ -876,8 +869,7 @@ mod prim_array {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_slice {} -#[cfg_attr(bootstrap, doc(primitive = "str"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "str")] +#[rustc_doc_primitive = "str"] /// String slices. /// /// *[See also the `std::str` module](crate::str).* @@ -944,8 +936,7 @@ mod prim_slice {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_str {} -#[cfg_attr(bootstrap, doc(primitive = "tuple"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "tuple")] +#[rustc_doc_primitive = "tuple"] #[doc(alias = "(")] #[doc(alias = ")")] #[doc(alias = "()")] @@ -1088,8 +1079,7 @@ impl<T: Copy> Copy for (T,) { // empty } -#[cfg_attr(bootstrap, doc(primitive = "f32"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "f32")] +#[rustc_doc_primitive = "f32"] /// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008). /// /// This type can represent a wide range of decimal numbers, like `3.5`, `27`, @@ -1155,8 +1145,7 @@ impl<T: Copy> Copy for (T,) { #[stable(feature = "rust1", since = "1.0.0")] mod prim_f32 {} -#[cfg_attr(bootstrap, doc(primitive = "f64"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "f64")] +#[rustc_doc_primitive = "f64"] /// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008). /// /// This type is very similar to [`f32`], but has increased @@ -1171,78 +1160,67 @@ mod prim_f32 {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_f64 {} -#[cfg_attr(bootstrap, doc(primitive = "i8"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "i8")] +#[rustc_doc_primitive = "i8"] // /// The 8-bit signed integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_i8 {} -#[cfg_attr(bootstrap, doc(primitive = "i16"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "i16")] +#[rustc_doc_primitive = "i16"] // /// The 16-bit signed integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_i16 {} -#[cfg_attr(bootstrap, doc(primitive = "i32"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "i32")] +#[rustc_doc_primitive = "i32"] // /// The 32-bit signed integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_i32 {} -#[cfg_attr(bootstrap, doc(primitive = "i64"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "i64")] +#[rustc_doc_primitive = "i64"] // /// The 64-bit signed integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_i64 {} -#[cfg_attr(bootstrap, doc(primitive = "i128"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "i128")] +#[rustc_doc_primitive = "i128"] // /// The 128-bit signed integer type. #[stable(feature = "i128", since = "1.26.0")] mod prim_i128 {} -#[cfg_attr(bootstrap, doc(primitive = "u8"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "u8")] +#[rustc_doc_primitive = "u8"] // /// The 8-bit unsigned integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_u8 {} -#[cfg_attr(bootstrap, doc(primitive = "u16"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "u16")] +#[rustc_doc_primitive = "u16"] // /// The 16-bit unsigned integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_u16 {} -#[cfg_attr(bootstrap, doc(primitive = "u32"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "u32")] +#[rustc_doc_primitive = "u32"] // /// The 32-bit unsigned integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_u32 {} -#[cfg_attr(bootstrap, doc(primitive = "u64"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "u64")] +#[rustc_doc_primitive = "u64"] // /// The 64-bit unsigned integer type. #[stable(feature = "rust1", since = "1.0.0")] mod prim_u64 {} -#[cfg_attr(bootstrap, doc(primitive = "u128"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "u128")] +#[rustc_doc_primitive = "u128"] // /// The 128-bit unsigned integer type. #[stable(feature = "i128", since = "1.26.0")] mod prim_u128 {} -#[cfg_attr(bootstrap, doc(primitive = "isize"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "isize")] +#[rustc_doc_primitive = "isize"] // /// The pointer-sized signed integer type. /// @@ -1252,8 +1230,7 @@ mod prim_u128 {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_isize {} -#[cfg_attr(bootstrap, doc(primitive = "usize"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "usize")] +#[rustc_doc_primitive = "usize"] // /// The pointer-sized unsigned integer type. /// @@ -1263,8 +1240,7 @@ mod prim_isize {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_usize {} -#[cfg_attr(bootstrap, doc(primitive = "reference"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "reference")] +#[rustc_doc_primitive = "reference"] #[doc(alias = "&")] #[doc(alias = "&mut")] // @@ -1396,8 +1372,7 @@ mod prim_usize {} #[stable(feature = "rust1", since = "1.0.0")] mod prim_ref {} -#[cfg_attr(bootstrap, doc(primitive = "fn"))] -#[cfg_attr(not(bootstrap), rustc_doc_primitive = "fn")] +#[rustc_doc_primitive = "fn"] // /// Function pointers, like `fn(usize) -> bool`. /// diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index 19641753ffe..f6a7c0a9f75 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -177,7 +177,7 @@ pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard}; #[unstable(feature = "lazy_cell", issue = "109736")] pub use self::lazy_lock::LazyLock; -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] pub use self::once_lock::OnceLock; pub(crate) use self::remutex::{ReentrantMutex, ReentrantMutexGuard}; diff --git a/library/std/src/sync/once_lock.rs b/library/std/src/sync/once_lock.rs index 36951c4f13e..e83bc35ee98 100644 --- a/library/std/src/sync/once_lock.rs +++ b/library/std/src/sync/once_lock.rs @@ -30,7 +30,7 @@ use crate::sync::Once; /// assert!(value.is_some()); /// assert_eq!(value.unwrap().as_str(), "Hello, World!"); /// ``` -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] pub struct OnceLock<T> { once: Once, // Whether or not the value is initialized is tracked by `once.is_completed()`. @@ -59,8 +59,8 @@ impl<T> OnceLock<T> { /// Creates a new empty cell. #[inline] #[must_use] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] - #[rustc_const_stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] + #[rustc_const_stable(feature = "once_cell", since = "1.70.0")] pub const fn new() -> OnceLock<T> { OnceLock { once: Once::new(), @@ -74,7 +74,7 @@ impl<T> OnceLock<T> { /// Returns `None` if the cell is empty, or being initialized. This /// method never blocks. #[inline] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] pub fn get(&self) -> Option<&T> { if self.is_initialized() { // Safe b/c checked is_initialized @@ -88,7 +88,7 @@ impl<T> OnceLock<T> { /// /// Returns `None` if the cell is empty. This method never blocks. #[inline] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] pub fn get_mut(&mut self) -> Option<&mut T> { if self.is_initialized() { // Safe b/c checked is_initialized and we have a unique access @@ -124,7 +124,7 @@ impl<T> OnceLock<T> { /// } /// ``` #[inline] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] pub fn set(&self, value: T) -> Result<(), T> { let mut value = Some(value); self.get_or_init(|| value.take().unwrap()); @@ -162,7 +162,7 @@ impl<T> OnceLock<T> { /// assert_eq!(value, &92); /// ``` #[inline] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T, @@ -239,7 +239,7 @@ impl<T> OnceLock<T> { /// assert_eq!(cell.into_inner(), Some("hello".to_string())); /// ``` #[inline] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] pub fn into_inner(mut self) -> Option<T> { self.take() } @@ -264,7 +264,7 @@ impl<T> OnceLock<T> { /// assert_eq!(cell.get(), None); /// ``` #[inline] - #[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] + #[stable(feature = "once_cell", since = "1.70.0")] pub fn take(&mut self) -> Option<T> { if self.is_initialized() { self.once = Once::new(); @@ -333,17 +333,17 @@ impl<T> OnceLock<T> { // scoped thread B, which fills the cell, which is // then destroyed by A. That is, destructor observes // a sent value. -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] unsafe impl<T: Sync + Send> Sync for OnceLock<T> {} -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] unsafe impl<T: Send> Send for OnceLock<T> {} -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceLock<T> {} -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T: UnwindSafe> UnwindSafe for OnceLock<T> {} -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T> Default for OnceLock<T> { /// Creates a new empty cell. /// @@ -362,7 +362,7 @@ impl<T> Default for OnceLock<T> { } } -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T: fmt::Debug> fmt::Debug for OnceLock<T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.get() { @@ -372,7 +372,7 @@ impl<T: fmt::Debug> fmt::Debug for OnceLock<T> { } } -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T: Clone> Clone for OnceLock<T> { #[inline] fn clone(&self) -> OnceLock<T> { @@ -387,7 +387,7 @@ impl<T: Clone> Clone for OnceLock<T> { } } -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T> From<T> for OnceLock<T> { /// Create a new cell with its contents set to `value`. /// @@ -414,7 +414,7 @@ impl<T> From<T> for OnceLock<T> { } } -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T: PartialEq> PartialEq for OnceLock<T> { #[inline] fn eq(&self, other: &OnceLock<T>) -> bool { @@ -422,10 +422,10 @@ impl<T: PartialEq> PartialEq for OnceLock<T> { } } -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] impl<T: Eq> Eq for OnceLock<T> {} -#[stable(feature = "once_cell", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "once_cell", since = "1.70.0")] unsafe impl<#[may_dangle] T> Drop for OnceLock<T> { #[inline] fn drop(&mut self) { diff --git a/library/std/src/sys/common/thread_local/fast_local.rs b/library/std/src/sys/common/thread_local/fast_local.rs index 914e017f7ff..447044a798b 100644 --- a/library/std/src/sys/common/thread_local/fast_local.rs +++ b/library/std/src/sys/common/thread_local/fast_local.rs @@ -11,7 +11,7 @@ use crate::{fmt, mem, panic}; pub macro thread_local_inner { // used to generate the `LocalKey` value for const-initialized thread locals (@key $t:ty, const $init:expr) => {{ - #[cfg_attr(not(bootstrap), inline)] + #[inline] #[deny(unsafe_op_in_unsafe_fn)] unsafe fn __getit( _init: $crate::option::Option<&mut $crate::option::Option<$t>>, @@ -78,7 +78,7 @@ pub macro thread_local_inner { #[inline] fn __init() -> $t { $init } - #[cfg_attr(not(bootstrap), inline)] + #[inline] unsafe fn __getit( init: $crate::option::Option<&mut $crate::option::Option<$t>>, ) -> $crate::option::Option<&'static $t> { diff --git a/library/std/src/sys/common/thread_local/os_local.rs b/library/std/src/sys/common/thread_local/os_local.rs index e9516f9983f..d004897df28 100644 --- a/library/std/src/sys/common/thread_local/os_local.rs +++ b/library/std/src/sys/common/thread_local/os_local.rs @@ -11,7 +11,7 @@ use crate::{fmt, marker, panic, ptr}; pub macro thread_local_inner { // used to generate the `LocalKey` value for const-initialized thread locals (@key $t:ty, const $init:expr) => {{ - #[cfg_attr(not(bootstrap), inline)] + #[inline] #[deny(unsafe_op_in_unsafe_fn)] unsafe fn __getit( _init: $crate::option::Option<&mut $crate::option::Option<$t>>, |
