Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd macro expansion errors with nested macros #95605

Closed
ThePuzzlemaker opened this issue Apr 2, 2022 · 2 comments
Closed

Odd macro expansion errors with nested macros #95605

ThePuzzlemaker opened this issue Apr 2, 2022 · 2 comments
Labels
C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. regression-untriaged Untriaged performance or correctness regression.

Comments

@ThePuzzlemaker
Copy link
Contributor

Code

I apologize that I can't get a full MCVE going at the moment.
The macro is defined in calypso_diagnostic/src/types.rs and used in calypso_parsing/src/lexer.rs. I originally thought this was related to #52234 after testing in the playground, but I'm not sure anymore as I've tried some workarounds that worked in the playground that did not work here, and did not change anything about the odd behaviour of rustc here.

I expected to see this happen: The program builds

Instead, this happened:

 error: no rules expected the token `E0001`
   --> libs/calypso_parsing/src/lexer.rs:276:55
    |
276 | ...                   b.code("E0001").short(err!(E0001)).label(
    |                                             ^^^^^^^^^^^ no rules expected this token in macro call
    |
    = note: this error originates in the macro `err` (in Nightly builds, run with -Z macro-backtrace for more info)

error: no rules expected the token `E0001`
   --> libs/calypso_parsing/src/lexer.rs:308:51
    |
308 | ...                   b.code("E0001").short(err!(E0001)).label(
    |                                             ^^^^^^^^^^^ no rules expected this token in macro call
    |
    = note: this error originates in the macro `err` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `calypso_parsing` due to 2 previous errors

Version it worked on

It most recently worked on: 1.59.0

Version with regression

rustc --version --verbose:

rustc 1.61.0-nightly (eb82facb1 2022-04-01)
binary: rustc
commit-hash: eb82facb1626166188d49599a3313fc95201f556
commit-date: 2022-04-01
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

@rustbot modify labels: +regression-from-stable-to-nightly +E-needs-mcve +E-needs-bisection

@ThePuzzlemaker ThePuzzlemaker added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 2, 2022
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Apr 2, 2022
@petrochenkov
Copy link
Contributor

Could you check whether it still happens with #95571?

@ThePuzzlemaker
Copy link
Contributor Author

@petrochenkov No, it does not occur with the latest nightly (which I assume includes that PR). Thanks!

@apiraino apiraino removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. regression-untriaged Untriaged performance or correctness regression.
Projects
None yet
Development

No branches or pull requests

4 participants