Expand on lints with macro spans.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- documentation
Research direction
Start with the diagnostics page covering allow, warn, deny, and forbid, then compare its treatment of macro-generated items with the external-macro example in this issue. Read the related issue 58502 for the local-identifier case. Done would require a clearly scoped explanation of lint behavior for macro spans, including the cases and lint phases that are in scope.
Written by the indexing model from the issue text.
Description
Lints behave a little strange with macros, particularly from external crates. This should probably be captured somewhere, probably the diagnostics page for allow/warn/deny/forbid.
For example, lints generated on items created by an extern macro do not fire. Calling the following will not trigger a (deny by default) lint:
#[macro_export]
macro_rules! thing {
() => {
#[no_mangle]
pub const FOO: i32 = 5;
}
}
See also https://github.com/rust-lang/rust/issues/58502 where the ident comes from the local crate, but does not pick up the global lint level of the extern crate.
So I imagine there are a variety of things to consider (the location of a span, the lint level of the local and extern crates, etc.). I don't know where to begin distilling how things work. Perhaps it is not as complex as it appears. I also get the impression that it depends on exactly which lint it is, since some are done at different phases.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 12
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.
More from rust-lang/reference
-
A-const-eval A-undefined-behavior
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
A-resolve
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
A-coercions
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
All issues in rust-lang/reference
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100