Open ijackson opened 4 months ago
I think this is the general, known issue that every pre-expansion lint pass runs into unfortunately... cc #12538 #7549 #5721 #6610 and probably a lot more
This lint could perhaps be rewritten as a normal post-expansion lint pass, but it would then no longer be able to lint cfgs that are false for the current compiler session
This lint could perhaps be rewritten as a normal post-expansion lint pass, but it would then no longer be able to lint cfgs that are false for the current compiler session
I think this means there needs to be a pre-expansion pass to look for #[allow]
s.
Also, it would have saved me the effort of filing this report, if the situation were documented. I think this would have to be a note in the docs for every pre-expansion lint.
Summary
Putting
#![allow(clippy::non_minimal_cfg)]
at the top of the module, or on the mod statement, sometimes doesn't work!Lint Name
non_minimal_cfg
To reproduce
Cargo toml
src/lib.rs
src/middle.rs
src/middle/inner.rs
empty.
Or from git:
Actual output
Expected output
No lint output.
Version
Notes
Moving the
#![allow()]
to an#[allow()]
onmod middle
doesn't help. Changing it to#[allow]
to apply only tomod inner
, makes the bug go away.Bizarrely, changing
mod inner;
tomod inner {}
makes the bug go away too!In my actual project I'm using
#![allow(clippy::complexity)]
at the crate top-level.