3 #![deny(rust_2021_incompatible_closure_captures)]
4 //~^ NOTE lint level is defined here
10 println!("dropped {}", self.0);
18 //~^ ERROR changes to closure capture in Rust 2021 will affect drop order
19 //~| NOTE for more information
21 //~^ NOTE in Rust 2018, this causes the closure to capture `f0`, but in Rust 2021, it has no effect
28 println!("dropping 0");
30 println!("dropping 1");
32 println!("dropped all");
34 //~^ NOTE in Rust 2018, `f0` is dropped here along with the closure, but in Rust 2021 `f0` is not part of the closure