Skip to content

[AVR] Failure to compile libcore on nightly #76833

Closed
@abusch

Description

@abusch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-AVRTarget: AVR processors (ATtiny, ATmega, etc.)T-libsRelevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions