Parse validation is oblivious to macro calls #18680
Labels
A-diagnostics
diagnostics / error reporting
A-macro
macro expansion
A-parser
parser issues
C-bug
Category: bug
Rust has two kings of parse errors:
The latter allows for stuff like
unsafe mod foo {}
to be accepted by attributes without issues, as long as they don't emitunsafe mod
again. That is,unsafe mod
is rejected in post expansion by validation. rustc does this by walking the fully expanded file tree with a validation pass. Our validation pass right now walks the unexpanded trees though which means we would (if we had a validation diagnostic forunsafe mod
) diagnose the following:where as rustc does not. The reason for this is mainl that rust-analyzer does not work on the fully expanded parse tree of a file, we keep the file parse and the macro parses separate so we need to figure something out here.
The text was updated successfully, but these errors were encountered: