-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for future-incompatibility lint out_of_scope_macro_calls #144406
Copy link
Copy link
Open
Labels
A-decl-macros-1-2Area: Declarative macros 1.2Area: Declarative macros 1.2A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.
Metadata
Metadata
Assignees
Labels
A-decl-macros-1-2Area: Declarative macros 1.2Area: Declarative macros 1.2A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The
out_of_scope_macro_callslint detectsmacro_rulescalled when they are not in scope,above their definition, which may happen in key-value attributes.
Example
Explanation
The scope in which a
macro_rulesitem is visible starts at that item and continuesbelow it. This is more similar to
letthan to other items, which are in scope both aboveand below their definition.
Due to a bug
macro_ruleswere accidentally in scope inside some key-value attributesabove their definition. The lint catches such cases.
To address the issue turn the
macro_rulesinto a regularly scoped item by importing itwith
use.Implementation history
out_of_scope_macro_callslint is registered #127191 integrated it into the allow/warn/deny infrastructureout_of_scope_macro_callssuppressunused_importsas well #147914 avoided an undesirableunused_importswarning