Lints while expanding builtin derives are not attributed to the correct AST nodes #121171
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-bug
Category: This is a bug.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: The code does not compile, as the lint is triggered on the struct.
Instead, this happened: The code compiles with a warning, as the lint uses the crate-root NodeId for reporting.
(This lint specifically uses
ast::CRATE_NODE_ID
rather thanecx.current_expansion.lint_node_id
, but the value oflint_node_id
during builtin derive expansion is alwaysast::CRATE_NODE_ID
)Found while implementing a lint for #121053.
I had a brief go at fixing this but it looks like AST nodes are all still using dummy IDs at the point of builtin derive expansion and I'm unfamiliar with the AST renumbering
The text was updated successfully, but these errors were encountered: