diff options
Diffstat (limited to 'tests/ui/error-codes/E0040.rs')
-rw-r--r-- | tests/ui/error-codes/E0040.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/error-codes/E0040.rs b/tests/ui/error-codes/E0040.rs new file mode 100644 index 000000000..9ffc42d0c --- /dev/null +++ b/tests/ui/error-codes/E0040.rs @@ -0,0 +1,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 +} |