Tracking Issue for future-incompatibility lint `out_of_scope_macro_calls`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
The out_of_scope_macro_calls lint detects macro_rules called when they are not in scope,
above their definition, which may happen in key-value attributes.
Example
#![doc = in_root!()]
macro_rules! in_root { () => { "" } }
fn main() {}
Explanation
The scope in which a macro_rules item is visible starts at that item and continues
below it. This is more similar to let than to other items, which are in scope both above
and below their definition.
Due to a bug macro_rules were accidentally in scope inside some key-value attributes
above their definition. The lint catches such cases.
To address the issue turn the macro_rules into a regularly scoped item by importing it
with use.
Implementation history
- https://github.com/rust-lang/rust/pull/125741 introduced the lint
- https://github.com/rust-lang/rust/pull/126987 fixed some positives
- https://github.com/rust-lang/rust/pull/127191 integrated it into the allow/warn/deny infrastructure
- https://github.com/rust-lang/rust/pull/143929 made the lint deny-by-default and report-in-deps
- https://github.com/rust-lang/rust/pull/147914 avoided an undesirable
unused_importswarning - XXX turned the lint into a hard error
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the lint behavior and implementation history through the linked pull requests, starting with the introduction of out_of_scope_macro_calls and its allow/warn/deny integration. The work is complete when the lint is turned into a hard error without reintroducing the documented false positives or the undesirable unused_imports warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100