a type error in a nested macro leads to a confusing compiler error message #45921
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-diagnostics
Working group: Diagnostics
Here's a toy program demonstrating the problem:
Compiling it (current stable rustc, 1.21) gives the following error:
All the compiler is telling me is that "something inside the macro generates this type error". In particular, it's not able to tell me that the problem is on line 6. I wouldn't be surprised if this was a known problem somewhere, but I wanted to make sure to report it, since it's probably super confusing for new developers. (For example, I expect you could run into this easily by combining
assert!
with another common macro likelazy_static!
.)The text was updated successfully, but these errors were encountered: