Closed
Description
I've been playing a bit with rust on an Arduino Uno with an atmega328p chip and since upgrading to the latest nightly, I am getting failures when it tries to compile libcore:
cargo build --release --bin pr02
Compiling compiler_builtins v0.1.35
Compiling core v0.0.0 (/home/abusch/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling proc-macro2 v1.0.21
Compiling unicode-xid v0.2.1
Compiling syn v1.0.41
Compiling semver-parser v0.7.0
Compiling proc-macro-hack v0.5.18
Compiling paste v1.0.1
Compiling semver v0.9.0
Compiling rustc_version v0.2.3
Compiling quote v1.0.7
Compiling bare-metal v0.2.5
error[E0527]: pattern requires 0 elements but array has 1
--> /home/abusch/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:861:13
|
861 | let [] = [(); align_of::<AtomicPtr<()>>() - align_of::<*mut ()>()];
| ^^ expected 1 element
error[E0527]: pattern requires 0 elements but array has 1
--> /home/abusch/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:1312:25
|
1312 | let [] = [(); align_of::<Self>() - align_of::<$int_type>()];
| ^^ expected 1 element
...
1998 | / atomic_int! {
1999 | | cfg(target_has_atomic = "16"),
2000 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
2001 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
... |
2013 | | i16 AtomicI16 ATOMIC_I16_INIT
2014 | | }
| |_- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
This with the latest nightly:
❯ rustc --verbose --version
rustc 1.48.0-nightly (285fc7d70 2020-09-16)
binary: rustc
commit-hash: 285fc7d704fcdd7b2a37d475d04d5d955490e000
commit-date: 2020-09-16
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0
I am using this target file: https://github.com/Rahix/avr-hal/blob/1c74cfca30de2fb8007d23d81540924e54d18cc8/chips/atmega328p-hal/avr-atmega328p.json