- Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Between nightly-2020-02-28 and nightly-2020-02-29 I observed that macro errors which used to point to a specific problematic identifier token now point equivocally to the entire macro invocation. See dtolnay/tt-call@364468e.
The issue minimizes to:
macro_rules! nothing_expected { () => {}; } macro_rules! repro { ($ident:ident) => { nothing_expected!($ident); }; } repro!(T);
Before; points to T
:
error: no rules expected the token `T` --> src/main.rs:11:8 | 1 | macro_rules! nothing_expected { | ----------------------------- when calling this macro ... 11 | repro!(T); | ^ no rules expected this token in macro call
After; does not point to T
:
error: no rules expected the token `T` --> src/main.rs:7:27 | 1 | macro_rules! nothing_expected { | ----------------------------- when calling this macro ... 7 | nothing_expected!($ident); | ^^^^^^ no rules expected this token in macro call ... 11 | repro!(T); | ---------- in this macro invocation | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
The applicable commit range is 6d69cab...0eb878d.
The most relevant looking PR in that range is #69384. @petrochenkov @Centril
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.