Skip to content

Commit

Permalink
Rollup merge of rust-lang#65461 - Kampfkarren:patch-1, r=Centril
Browse files Browse the repository at this point in the history
Don't recommend ONCE_INIT in std::sync::Once

ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.
  • Loading branch information
Centril committed Oct 16, 2019
2 parents 20cbfd3 + 247df6e commit 2fef053
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libstd/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ use crate::thread::{self, Thread};

/// A synchronization primitive which can be used to run a one-time global
/// initialization. Useful for one-time initialization for FFI or related
/// functionality. This type can only be constructed with the [`ONCE_INIT`]
/// value or the equivalent [`Once::new`] constructor.
/// functionality. This type can only be constructed with the [`Once::new`]
/// constructor.
///
/// [`ONCE_INIT`]: constant.ONCE_INIT.html
/// [`Once::new`]: struct.Once.html#method.new
///
/// # Examples
Expand Down

0 comments on commit 2fef053

Please sign in to comment.