about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-20 12:06:12 +0000
committerbors <bors@rust-lang.org>2020-02-20 12:06:12 +0000
commit93711d063b2e369d7095ddd4c76c33c886411730 (patch)
treec4a2877b4ed7089b964f12dd16d2ffb618502706 /src/libstd/sync
parent6af388b25050bca26710be7e4030e17bf6d8d2f7 (diff)
parent941ce1a557639e23ccb8cf2610aa8341190dbdfa (diff)
downloadrust-93711d063b2e369d7095ddd4c76c33c886411730.tar.gz
rust-93711d063b2e369d7095ddd4c76c33c886411730.zip
Auto merge of #69309 - Dylan-DPC:rollup-gjdqx7l, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #68705 (Add LinkedList::remove())
 - #68945 (Stabilize Once::is_completed)
 - #68978 (Make integer exponentiation methods unstably const)
 - #69266 (Fix race condition when allocating source files in SourceMap)
 - #69287 (Clean up E0317 explanation)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/once.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index 61c4d0c2dbf..b99b4d8d9fd 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -331,14 +331,14 @@ impl Once {
     ///   * `call_once` was called, but has not yet completed,
     ///   * the `Once` instance is poisoned
     ///
-    /// It is also possible that immediately after `is_completed`
-    /// returns false, some other thread finishes executing
-    /// `call_once`.
+    /// This function returning `false` does not mean that `Once` has not been
+    /// executed. For example, it may have been executed in the time between
+    /// when `is_completed` starts executing and when it returns, in which case
+    /// the `false` return value would be stale (but still permissible).
     ///
     /// # Examples
     ///
     /// ```
-    /// #![feature(once_is_completed)]
     /// use std::sync::Once;
     ///
     /// static INIT: Once = Once::new();
@@ -351,7 +351,6 @@ impl Once {
     /// ```
     ///
     /// ```
-    /// #![feature(once_is_completed)]
     /// use std::sync::Once;
     /// use std::thread;
     ///
@@ -364,7 +363,7 @@ impl Once {
     /// assert!(handle.join().is_err());
     /// assert_eq!(INIT.is_completed(), false);
     /// ```
-    #[unstable(feature = "once_is_completed", issue = "54890")]
+    #[stable(feature = "once_is_completed", since = "1.44.0")]
     #[inline]
     pub fn is_completed(&self) -> bool {
         // An `Acquire` load is enough because that makes all the initialization