-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-hygieneArea: Macro hygieneArea: Macro hygieneA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow 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.
Description
Spawned off of #24162. Our lifetimes only carry a Name
, not an Ident
, which means the comparisons for shadowing are only doing name based comparisons.
But macros should be free to introduce labels, and have them be treated as independent due to hygiene.
This bug is believed to only introduce issues where code will cause a warning to be emitted by the new shadowing check when it should be accepted; i.e. there are not any known soundness issues associated with this problem.
(Note: While loop labels themselves are Ident
s, much of the syntax system does not treat them the same way it treats "normal" variables with respect to e.g. hygiene. For example the syntax::visit
system does not invoke visit_ident
on loop labels.)
Metadata
Metadata
Assignees
Labels
A-hygieneArea: Macro hygieneArea: Macro hygieneA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow 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.