Closed
Description
Recent occurrence similar to #98378, example adapted from there:
% cat run.sh
#!/bin/bash
rustup default nightly-2022-10-17
rustup component add rust-src
cargo new --lib foo
cd foo
echo '#![no_std]' > src/lib.rs
cargo build -Z build-std --target x86_64-unknown-none
% ./run.sh
...
error: `sys_common::once::generic::Once::new` is not yet stable as a const fn
--> ~/.rustup/toolchains/nightly-2022-10-17-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:70:23
|
70 | Once { inner: sys::Once::new() }
| ^^^^^^^^^^^^^^^^
|
= help: const-stable functions can only call other const-stable functions
error: could not compile `std` due to previous error
I can repro the same error via x.py
:
python3 x.py build library/std --target x86_64-unknown-none
https://users.rust-lang.org/t/compile-error-with-build-std-std/82696 mentions the same error.
I'll see if something similar to #98457 resolves this.