Attribute macro within macro_rules! macro causes error messages to lose spans #75801
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
A-proc-macros
Area: Procedural macros
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I tried the following on the current nightly build:
I expected to see something like the following:
Instead, the error message lacks any span or additional context at all:
Removing the
#[foo]
from themacro_rules!
body, or writing#[foo] fn bar() { ... }
manually without going through thefoo!
macro, produces a correct error message; it's only when they are combined that the error loses contextual information.Meta
The current beta and nightly builds are affected:
rustc --version --verbose
:The current stable version displays the expected behavior.
The text was updated successfully, but these errors were encountered: