Closed
Description
struct Droppy;
impl Drop for Droppy {
fn drop(&mut self) {
println!("2");
}
}
fn main() {
let q = Droppy;
(||{
println!("1");
q;
})();
println!("3");
}
warning: path statement with no effect
--> src/main.rs:13:9
|
13 | q;
| ^^
|
= note: #[warn(path_statements)] on by default
Removing the "no effect" line definitely has effect.
The warning may instead suggest to explicitly use std::mem::drop
if that is what is needed.