]> git.proxmox.com Git - rustc.git/blame - src/test/ui/explicit/explicit-call-to-dtor.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / explicit / explicit-call-to-dtor.rs
CommitLineData
5869c6ff 1// run-rustfix
223e47cc 2struct Foo {
1a4d82fc 3 x: isize
223e47cc
LB
4}
5
6impl Drop for Foo {
1a4d82fc
JJ
7 fn drop(&mut self) {
8 println!("kaboom");
223e47cc
LB
9 }
10}
11
12fn main() {
13 let x = Foo { x: 3 };
5869c6ff 14 println!("{}", x.x);
1a4d82fc 15 x.drop(); //~ ERROR explicit use of destructor method
223e47cc 16}