-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
shadow_unrelated false positive with question mark #6563
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Comments
camsteffen
added
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
labels
Jan 7, 2021
This might be the same issue as #6141. |
On the playground it repros on stable and nightly with just a closure. #![deny(clippy::shadow_unrelated)]
fn main() {
let foo = 0;
let foo = || foo;
} Expected result: no error, since Actual result: shadow_unrelated error
|
This is another bizarre false positive I get:
|
Merged
bors
added a commit
that referenced
this issue
Sep 30, 2021
Re-write shadow lints changelog: Move shadow_unrelated to restriction changelog: The shadow lints find a lot more shadows and are not limited to certain patterns Drastically simplifies the implementation. Catches a lot more cases. I removed the "initialization happens here" note. It is not helpful IMO. Closes #318 Fixes #2890 Fixes #6563 Fixes #7588 Fixes #7620
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Lint name: shadow_unrelated
I tried this code:
I expected to see this happen: no lint
Instead, this happened: shadow_unrelated lint
I needed a closure and a question mark to reproduce this. 🤷
The text was updated successfully, but these errors were encountered: