]> git.lizzy.rs Git - rust.git/blob - src/test/ui/explicit/explicit-call-to-dtor.rs
Rollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay
[rust.git] / src / test / 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 }