rust/tests/ui/error-codes/E0040.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
243 B
Rust
Raw Normal View History

// run-rustfix
2016-05-19 12:00:43 +00:00
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
2016-05-19 12:00:43 +00:00
}