From 7c1e4054787f99dff36aa66318b7589f78dfc7d9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 17 Jul 2019 10:34:34 +0200 Subject: ONCE_INIT is deprecated-in-future only for bootstrap --- src/libstd/io/util.rs | 2 +- src/libstd/sync/mod.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index 20979e02a43..33cc87eb795 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -48,7 +48,7 @@ pub fn copy(reader: &mut R, writer: &mut W) -> io::Result< // `MaybeUninit`. Revisit this once we decided whether that is valid or not. // This is still technically undefined behavior due to creating a reference // to uninitialized data, but within libstd we can rely on more guarantees - // than if this code were in an external lib + // than if this code were in an external lib. unsafe { reader.initializer().initialize(buf.get_mut()); } let mut written = 0; diff --git a/src/libstd/sync/mod.rs b/src/libstd/sync/mod.rs index 5d4cdb16472..e29faf18d83 100644 --- a/src/libstd/sync/mod.rs +++ b/src/libstd/sync/mod.rs @@ -163,7 +163,8 @@ pub use self::condvar::{Condvar, WaitTimeoutResult}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::mutex::{Mutex, MutexGuard}; #[stable(feature = "rust1", since = "1.0.0")] -#[allow(deprecated_in_future)] +#[cfg_attr(bootstrap, allow(deprecated_in_future))] +#[allow(deprecated)] pub use self::once::{Once, OnceState, ONCE_INIT}; #[stable(feature = "rust1", since = "1.0.0")] pub use crate::sys_common::poison::{PoisonError, TryLockError, TryLockResult, LockResult}; -- cgit 1.4.1-3-g733a5