-
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
let_underscore_drop complains about idiomatic let _ = ignorable_result
;
#8003
Comments
Maybe this is correct? |
You're right, the However, I will then reformulate the issue: it is idiomatic (at least I thought so) to discard So the lint should maybe just get an exception for the |
std::io::Result<()>
implements Droplet _ = ignorable_result
;
I am not convinced that |
Sure it is only |
Thinking about it more, I agree that it would make sense to allow this lint for the Result type, at least if only the Error type implements drop. Maybe we could still have a configuration value, but the default configuration could allow Result by default. :) |
would it be possible to determine whether the only |
Lint name: let_underscore_drop
I tried this code:
I expected to see this happen: no clippy errors
Instead, this happened: clippy wants to keep the Result around until end of scope, while
let _ =
is the normally suggested way to deal with results where there is no useful Ok and the Err needs to be ignored.[edit: this originally suggested that the Drop bound is wrongly inferred.]
Meta
Rust version: Nightly on Playground (2021-11-19 a77da2d)
The text was updated successfully, but these errors were encountered: