summaryrefslogtreecommitdiffstats
path: root/tests/ui/error-codes/E0040.rs
blob: 9ffc42d0c78048b5a52e9d040aa7d422cef11fcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// run-rustfix
struct Foo {
    x: i32,
}

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

fn main() {
    let mut x = Foo { x: -7 };
    x.x = 0;
    println!("{}", x.x);
    x.drop();
    //~^ ERROR E0040
}