Closed
Description
env:
arch: aarch64
os: alpine 3.20
version: 0.1.160
code:
use std::sync::atomic::AtomicU32;
use std::sync::atomic::Ordering;
static data: AtomicU32 = AtomicU32::new(1);
#[must_use]
fn read_data() -> u32 {
data.load(Ordering::Relaxed)
}
fn write_data() -> u32 {
data.fetch_add(1, Ordering::Relaxed)
}
fn main() {
println!("Hello, world! {}", read_data());
}
build flag:
RUSTFLAGS="-Zfmt-debug=none " cargo +nightly build -Z build-std=std,panic_abort -Z unstable-options
build error log:
note: while trying to match meta-variable `$ordering:ident`
--> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.160/src/aarch64_linux.rs:260:6
|
260 | ($ordering:ident, $bytes:tt, $name:ident) => {
| ^^^^^^^^^^^^^^^
= note: this error originates in the macro `foreach_ldset` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected `,`
--> /tmp/test_atomic/target/debug/build/compiler_builtins-f849036744b13993/out/outlined_atomics.rs:89:10
|
89 | $macro!( , 8, __aarch64_ldset8_acq_rel );
| ^ no rules expected this token in macro call
|
::: /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.160/src/aarch64_linux.rs:259:1
|
259 | macro_rules! or {
| --------------- when calling this macro
...
273 | foreach_ldset!(or);
| ------------------ in this macro invocation
|
note: while trying to match meta-variable `$ordering:ident`
--> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/compiler_builtins-0.1.160/src/aarch64_linux.rs:260:6
|
260 | ($ordering:ident, $bytes:tt, $name:ident) => {
| ^^^^^^^^^^^^^^^
= note: this error originates in the macro `foreach_ldset` (in Nightly builds, run with -Z macro-backtrace for more info)
After some troubleshooting, it turns out that compiler_builtins depends on the Debug
trait in the build.rs
compiler-builtins/compiler-builtins/build.rs
Lines 173 to 177 in cd0f202
Metadata
Metadata
Assignees
Labels
No labels