Skip to content

Compilation failure after #92472 merged in #95569

Closed
@TDHolmes

Description

@TDHolmes

As of nightly-2022-03-28, some of our code utilizing macros in atsamd started to fail to compile. The code that is failing is some macro magic for making nice pin name aliases for microcontrollers, so it's not surprising that #92472 broke it. I see that some other repos were broken as well and that @petrochenkov helped fix it, but I'm really not sure how to do the fix in our repo.

Code

To reproduce:

  1. clone the atsamd repo
  2. rustup default nightly-2022-03-28 && rustup target add thumbv6m-none-eabi
  3. cd atsamd/boards/feather_m0
  4. cargo check --example=blinky_basic

I expect this to compile properly like on stable, instead it fails to compile with:

error: no rules expected the token `red_led`
  --> examples/blinky_basic.rs:30:52
   |
30 |     let mut red_led: bsp::RedLed = pin_alias!(pins.red_led).into();
   |                                                    ^^^^^^^ no rules expected this token in macro call

Version it worked on

It most recently worked on: nightly-2022-03-27

Version with regression

Regressed to 551b4fa with cargo-bisect-rustc (cargo bisect-rustc --start=1d9c262eea411ec5230f8a4c9ba50b3647064da4 --end=ab0c2e18dceb7140626a158affb983ae81039bd0 --target thumbv6m-none-eabi -- check --example=blinky_basic)

rustc --version --verbose:

rustc --version --verbose
rustc 1.61.0-nightly (ab0c2e18d 2022-03-27)
binary: rustc
commit-hash: ab0c2e18dceb7140626a158affb983ae81039bd0
commit-date: 2022-03-27
host: x86_64-apple-darwin
release: 1.61.0-nightly
LLVM version: 14.0.0
installed targets for active toolchain
--------------------------------------
thumbv6m-none-eabi
x86_64-apple-darwin

active toolchain
----------------
nightly-2022-03-28-x86_64-apple-darwin (default)
rustc 1.61.0-nightly (ab0c2e18d 2022-03-27)

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions