blob: ac2ca3770f0fd22597b9720f23d04394cca78cfc [file] [log] [blame] [edit]
//@ 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
}