we can now enable the 'const stable fn must be stable' check · qinheping/verify-rust-std@4f4a6c6 (original) (raw)
4 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -5,7 +5,7 @@ pub struct Condvar {} | ||
5 | 5 | |
6 | 6 | impl Condvar { |
7 | 7 | #[inline] |
8 | -#[rustc_const_stable(feature = "const_locks", since = "1.63.0")] | |
8 | +#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_locks", since = "1.63.0"))] | |
9 | 9 | pub const fn new() -> Condvar { |
10 | 10 | Condvar {} |
11 | 11 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,7 +10,7 @@ unsafe impl Sync for Mutex {} // no threads on this platform | ||
10 | 10 | |
11 | 11 | impl Mutex { |
12 | 12 | #[inline] |
13 | -#[rustc_const_stable(feature = "const_locks", since = "1.63.0")] | |
13 | +#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_locks", since = "1.63.0"))] | |
14 | 14 | pub const fn new() -> Mutex { |
15 | 15 | Mutex { locked: Cell::new(false) } |
16 | 16 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -35,7 +35,7 @@ unsafe impl Sync for Once {} | ||
35 | 35 | |
36 | 36 | impl Once { |
37 | 37 | #[inline] |
38 | -#[rustc_const_stable(feature = "const_once_new", since = "1.32.0")] | |
38 | +#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_once_new", since = "1.32.0"))] | |
39 | 39 | pub const fn new() -> Once { |
40 | 40 | Once { state: Cell::new(State::Incomplete) } |
41 | 41 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,7 +10,7 @@ unsafe impl Sync for RwLock {} // no threads on this platform | ||
10 | 10 | |
11 | 11 | impl RwLock { |
12 | 12 | #[inline] |
13 | -#[rustc_const_stable(feature = "const_locks", since = "1.63.0")] | |
13 | +#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_locks", since = "1.63.0"))] | |
14 | 14 | pub const fn new() -> RwLock { |
15 | 15 | RwLock { mode: Cell::new(0) } |
16 | 16 | } |