16 lines
190 B
Rust
16 lines
190 B
Rust
struct Foo {
|
|
x: i32,
|
|
}
|
|
|
|
impl Drop for Foo {
|
|
fn drop(&mut self) {
|
|
println!("kaboom");
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let mut x = Foo { x: -7 };
|
|
x.drop();
|
|
//~^ ERROR E0040
|
|
}
|