Skip to content
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

let_underscore_drop and ignoring error #9314

Closed
uselessgoddess opened this issue Aug 9, 2022 · 0 comments · Fixed by #9697
Closed

let_underscore_drop and ignoring error #9314

uselessgoddess opened this issue Aug 9, 2022 · 0 comments · Fixed by #9697
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't

Comments

@uselessgoddess
Copy link

uselessgoddess commented Aug 9, 2022

I ignore some errors with try block. I annotate type via let _: Result<...> = try { ... }. But clippy:

warning: non-binding `let` on a type that implements `Drop`
  --> some/path:
   |
   | /         let _: Result<_> = try {
   | |            . . .
   | |         };
   | |__________^
   |
   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

How can I fix this

@uselessgoddess uselessgoddess added C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't labels Aug 9, 2022
bors added a commit that referenced this issue Oct 23, 2022
Move `let_underscore_drop` to restriction

Because of things like #9314. `let _` is considered the idiomatic way to ignore `must_use`: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute

changelog: [`let_underscore_drop`]: move to restriction

r? `@flip1995`
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-negative Issue: The lint should have been triggered on code, but wasn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant