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