Closed
Description
Lint name: let_underscore_drop
I tried this code:
#![allow(unused)]
#![deny(clippy::let_underscore_drop)]
struct Test;
impl Test {
fn causes_error(&self) -> Result<(), std::io::Error> {
todo!()
}
fn bug(&self) {
let _ = self.causes_error();
}
}
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)