-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unknown_lints
doesn't trigger in all cfg_attr
#97094
Comments
This seems to have been a regression of the 1.29.0 compiler: the warnings on 1.28.0 are just fine. The issue is that For some reason,
|
Expectably, as the same code also handles the |
I think the best solution for this is to move the lints into a late lint pass. Maybe the push stuff could be called after cfg expansion but this could have side effects for other lints, idk. @rustbot claim |
So it turns out that allowing the #[cfg_attr(all(), allow(unknown_lints, while_true))]
mod bar {
#[allow(noex_inside_module)] // Warns for the unknown lint name here due to the allow above not working
fn _foo() { while true {} } // Doesn't warn for the `while true` here due to the allow working
} This opens the possibility of just moving the |
Oh so apparently the |
I've made a PR: #97266 |
I tried this code:
Playground Link
I expected attributs in all 4 positions to cause compiler errors, but just the first one (inner attribute on the root module) does. When using
allow
withoutcfg_attr
I get all 4 errors. Came across this while debugging why adding#![cfg_attr(feature = "name", allow(unused_macro_rules))]
didn't introduce new warnings onstable
in a module.Meta
This happens in at least:
1.60.0
1.61.0-beta.7
nightly-2022-05-15
which are the versions currently on the playground
The text was updated successfully, but these errors were encountered: