We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2dbd623 + 3c9aa69 commit 8f359beCopy full SHA for 8f359be
library/std/src/sync/barrier.rs
@@ -81,8 +81,10 @@ impl Barrier {
81
/// let barrier = Barrier::new(10);
82
/// ```
83
#[stable(feature = "rust1", since = "1.0.0")]
84
+ #[rustc_const_stable(feature = "const_barrier", since = "CURRENT_RUSTC_VERSION")]
85
#[must_use]
- pub fn new(n: usize) -> Barrier {
86
+ #[inline]
87
+ pub const fn new(n: usize) -> Barrier {
88
Barrier {
89
lock: Mutex::new(BarrierState { count: 0, generation_id: 0 }),
90
cvar: Condvar::new(),
0 commit comments