1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// run-rustfix struct Foo { x: i32, } impl Drop for Foo { fn drop(&mut self) { println!("kaboom"); } } fn main() { let mut x = Foo { x: -7 }; x.x = 0; println!("{}", x.x); x.drop(); //~^ ERROR E0040 }