]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0040.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / error-codes / E0040.rs
1 // run-rustfix
2 struct Foo {
3     x: i32,
4 }
5
6 impl Drop for Foo {
7     fn drop(&mut self) {
8         println!("kaboom");
9     }
10 }
11
12 fn main() {
13     let mut x = Foo { x: -7 };
14     x.x = 0;
15     println!("{}", x.x);
16     x.drop();
17     //~^ ERROR E0040
18 }