diff options
| author | bors <bors@rust-lang.org> | 2024-06-12 18:15:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-12 18:15:32 +0000 |
| commit | c25ac9d6cc285e57e1176dc2da6848b9d0163810 (patch) | |
| tree | 4b359d430db4881929f0360f9aef9c5b26009f25 /library/std/src | |
| parent | 1d43fbbc7348f2bd9260d8532bffa02f5bd2c9ac (diff) | |
| parent | 48e614a84b1bfb9e35e8f48fcb0d572a8ac287a2 (diff) | |
| download | rust-c25ac9d6cc285e57e1176dc2da6848b9d0163810.tar.gz rust-c25ac9d6cc285e57e1176dc2da6848b9d0163810.zip | |
Auto merge of #126273 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum
Bump stage0 to 1.80.0 r? `@Mark-Simulacrum`
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/env.rs | 16 | ||||
| -rw-r--r-- | library/std/src/io/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/prelude/common.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sync/lazy_lock.rs | 22 | ||||
| -rw-r--r-- | library/std/src/sync/mod.rs | 2 |
5 files changed, 14 insertions, 30 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 295e782639b..2f35e721610 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -363,20 +363,12 @@ impl Error for VarError { /// } /// assert_eq!(env::var(key), Ok("VALUE".to_string())); /// ``` -#[cfg(not(bootstrap))] #[rustc_deprecated_safe_2024] #[stable(feature = "env", since = "1.0.0")] pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) { _set_var(key.as_ref(), value.as_ref()) } -#[cfg(bootstrap)] -#[allow(missing_docs)] -#[stable(feature = "env", since = "1.0.0")] -pub fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) { - unsafe { _set_var(key.as_ref(), value.as_ref()) } -} - unsafe fn _set_var(key: &OsStr, value: &OsStr) { os_imp::setenv(key, value).unwrap_or_else(|e| { panic!("failed to set environment variable `{key:?}` to `{value:?}`: {e}") @@ -438,20 +430,12 @@ unsafe fn _set_var(key: &OsStr, value: &OsStr) { /// } /// assert!(env::var(key).is_err()); /// ``` -#[cfg(not(bootstrap))] #[rustc_deprecated_safe_2024] #[stable(feature = "env", since = "1.0.0")] pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) { _remove_var(key.as_ref()) } -#[cfg(bootstrap)] -#[allow(missing_docs)] -#[stable(feature = "env", since = "1.0.0")] -pub fn remove_var<K: AsRef<OsStr>>(key: K) { - unsafe { _remove_var(key.as_ref()) } -} - unsafe fn _remove_var(key: &OsStr) { os_imp::unsetenv(key) .unwrap_or_else(|e| panic!("failed to remove environment variable `{key:?}`: {e}")) diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index f55ec1588f9..97b72f9664b 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -2058,7 +2058,7 @@ pub trait Seek { /// ``` /// /// [`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(()) diff --git a/library/std/src/prelude/common.rs b/library/std/src/prelude/common.rs index ceee3e33c3e..055ab7eb6d9 100644 --- a/library/std/src/prelude/common.rs +++ b/library/std/src/prelude/common.rs @@ -14,7 +14,7 @@ pub use crate::ops::{Drop, Fn, FnMut, FnOnce}; #[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}; diff --git a/library/std/src/sync/lazy_lock.rs b/library/std/src/sync/lazy_lock.rs index 7a2eed93dd4..b70c041fa42 100644 --- a/library/std/src/sync/lazy_lock.rs +++ b/library/std/src/sync/lazy_lock.rs @@ -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 @@ impl<T, F: FnOnce() -> T> LazyLock<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 @@ impl<T, F> LazyLock<T, F> { } } -#[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 @@ impl<T, F> Drop for LazyLock<T, F> { } } -#[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 @@ impl<T, F: FnOnce() -> T> Deref for LazyLock<T, F> { } } -#[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 @@ impl<T: Default> Default for 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 @@ impl<T: fmt::Debug, F> fmt::Debug for LazyLock<T, F> { // 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)] diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index 70e8f5f90c6..2a13b1a8ae2 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -182,7 +182,7 @@ pub use self::rwlock::{MappedRwLockReadGuard, MappedRwLockWriteGuard}; #[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; |
