Span for unused_macros
lint is too large, which makes writing macros in IDEs annoying
#90745
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (playground):
The current output is:
Note how the span for the
unused_macros
lint covers the entire macro definition. This is fine for terminal diagnostic output, but when using an IDE or a Rust language server, this causes the entire macro definition to be underlined with yellow:In my experience, this tends to make writing macros obnoxious without allowing
unused_macros
(either globally or locally).Ideally, the span for this lint should be reduced to the macro's identifier, similar to how the
dead_code
lint's span only highlightsbar
's identifier:@rustbot modify labels: +A-macros +C-enhancement
The text was updated successfully, but these errors were encountered: