Specifying lint levels does not work on macros #87391
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
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:
Ideally in this case, the compilation should succeed without warning, as the lint appears to have been explicitly allowed everywhere it is used.
This likely applies for all lints and all lint levels and all macros
println!
,dbg!
, andasm!
with allow, warn, and deny forirrefutable_let_patterns
as well as in in my in progress lintnamed_asm_labels
)A current workaround is to create a scope to put the macro in, and apply the lint level to that scope, as demonstrated in the example.
Applying the lint level to the crate with
#![level(lint)]
works as expected, however this is often not desirable.Possibly related: #59306
The text was updated successfully, but these errors were encountered: