Rollup merge of #103193 - krasimirgg:sysonce, r=Amanieu

mark sys_common::once::generic::Once::new const-stable

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

This is similar to https://github.com/rust-lang/rust/pull/98457.

With this in, `python3 x.py build library/std --target x86_64-unknown-none` succeeds.
This commit is contained in:
Manish Goregaokar 2022-11-22 01:26:07 -05:00 committed by GitHub
commit 3683c43a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) }
}