Skip to content

Commit

Permalink
Rollup merge of #103193 - krasimirgg:sysonce, r=Amanieu
Browse files Browse the repository at this point in the history
mark sys_common::once::generic::Once::new const-stable

Attempt to address rust-lang/rust#103191 by marking the impl const-stable.
Picked the declaration from the callsite:
https://github.com/rust-lang/rust/blob/21b246587c2687935bd6004ffa5dcc4f4dd6600d/library/std/src/sync/once.rs#L67

This is similar to rust-lang/rust#98457.

With this in, `python3 x.py build library/std --target x86_64-unknown-none` succeeds.
  • Loading branch information
Manishearth authored Nov 22, 2022
2 parents ef2b88a + 9d41991 commit 7beed68
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions std/src/sys_common/once/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ struct WaiterQueue<'a> {

impl Once {
#[inline]
#[rustc_const_stable(feature = "const_once_new", since = "1.32.0")]
pub const fn new() -> Once {
Once { state_and_queue: AtomicPtr::new(ptr::invalid_mut(INCOMPLETE)) }
}
Expand Down

0 comments on commit 7beed68

Please sign in to comment.