diff options
Diffstat (limited to 'tests/ui/explicit/explicit-call-to-dtor.fixed')
-rw-r--r-- | tests/ui/explicit/explicit-call-to-dtor.fixed | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/explicit/explicit-call-to-dtor.fixed b/tests/ui/explicit/explicit-call-to-dtor.fixed new file mode 100644 index 000000000..91a4ca608 --- /dev/null +++ b/tests/ui/explicit/explicit-call-to-dtor.fixed @@ -0,0 +1,16 @@ +// run-rustfix +struct Foo { + x: isize +} + +impl Drop for Foo { + fn drop(&mut self) { + println!("kaboom"); + } +} + +fn main() { + let x = Foo { x: 3 }; + println!("{}", x.x); + drop(x); //~ ERROR explicit use of destructor method +} |