]> git.lizzy.rs Git - rust.git/blob - tests/ui/explicit/explicit-call-to-dtor.rs
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / explicit / explicit-call-to-dtor.rs
1 // run-rustfix
2 struct Foo {
3     x: isize
4 }
5
6 impl Drop for Foo {
7     fn drop(&mut self) {
8         println!("kaboom");
9     }
10 }
11
12 fn main() {
13     let x = Foo { x: 3 };
14     println!("{}", x.x);
15     x.drop();   //~ ERROR explicit use of destructor method
16 }