summary refs log tree commit diff
path: root/src/test/ui/explicit/explicit-call-to-dtor.rs
blob: a6f9acc37a16d688fa5d1b2bac134fc371159077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct Foo {
    x: isize
}

impl Drop for Foo {
    fn drop(&mut self) {
        println!("kaboom");
    }
}

fn main() {
    let x = Foo { x: 3 };
    x.drop();   //~ ERROR explicit use of destructor method
}