-
Notifications
You must be signed in to change notification settings - Fork 1.7k
allow
only works with some lints if and only if they're allowed both in the crate root and in the desired module
#7290
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
Comments
Thanks! Any lints other than |
now you mention it, i've seen a similar problem with see https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/172#note_2767740 |
This makes Clippy hard to use with generated files, like lalrpop output, because the offending patterns may occur hundreds of times, and the legitimate warnings are hard to find. Here's another case, with a single source file:
Output:
|
Finding that Another way to trigger the effect is to use the command line option: |
I tried this code:
I expected to see this happen: The lint is silenced for the module
Instead, this happened: The lint was not silenced, and fired anyway in the output of
cargo clippy
It may be worth mentioning that the lint is silenced if and only if the
allow
exists both in the crate root and in the moduleThis bug also occurs with other lints, but does not occur with all lints: I've been able to cause it with
items_after_statements
, but not withenum_glob_use
ormatch_same_arms
. In the case of the latter two, the lint was silenced for the module without the need toallow
it in the crate root as well.Meta
cargo clippy -V
: clippy 0.1.54 (1c6868a 2021-05-27)rustc -Vv
:The text was updated successfully, but these errors were encountered: