about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-13 12:52:29 +0000
committerbors <bors@rust-lang.org>2019-06-13 12:52:29 +0000
commit57a3300c2538fd1044ce45d9ef3b82182acb57ae (patch)
tree3fa262efda57b73d9e6143b9e6ee569fecccd9c4 /src/libstd/sync
parent96636f3eb8206f7499451ebc5b347d000d7aee08 (diff)
parent8917b8e32ca5928b83afc8da03746acb4914a53a (diff)
downloadrust-57a3300c2538fd1044ce45d9ef3b82182acb57ae.tar.gz
rust-57a3300c2538fd1044ce45d9ef3b82182acb57ae.zip
Auto merge of #61799 - Centril:rollup-vpm5uxr, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #61598 (Handle index out of bound errors during const eval without panic)
 - #61720 (std: Remove internal definitions of `cfg_if!` macro)
 - #61757 (Deprecate ONCE_INIT in future 1.38 release)
 - #61766 (submodules: update clippy from c0dbd34b to bd33a97c)
 - #61791 (Small cleanup in `check_pat_path`)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/mod.rs1
-rw-r--r--src/libstd/sync/once.rs5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/sync/mod.rs b/src/libstd/sync/mod.rs
index 809ee882698..fd6e46fd61d 100644
--- a/src/libstd/sync/mod.rs
+++ b/src/libstd/sync/mod.rs
@@ -163,6 +163,7 @@ 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)]
 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};
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index 0c912494024..e529b8c4227 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -115,6 +115,11 @@ pub struct OnceState {
 /// static START: Once = ONCE_INIT;
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_deprecated(
+    since = "1.38.0",
+    reason = "the `new` function is now preferred",
+    suggestion = "Once::new()",
+)]
 pub const ONCE_INIT: Once = Once::new();
 
 // Four states that a Once can be in, encoded into the lower bits of `state` in