2 #![deny(rust_2021_incompatible_closure_captures)]
3 //~^ NOTE: the lint level is defined here
5 // Test the two possible cases for automated migartion using rustfix
6 // - Closure contains a block i.e. `|| { .. };`
7 // - Closure contains just an expr `|| ..;`
13 println!("{:?} dropped", self.0);
17 fn closure_contains_block() {
18 let t = (Foo(0), Foo(0));
20 //~^ ERROR: drop order
21 //~| NOTE: for more information, see
22 //~| HELP: add a dummy let to cause `t` to be fully captured
29 fn closure_doesnt_contain_block() {
30 let t = (Foo(0), Foo(0));
32 //~^ ERROR: drop order
33 //~| NOTE: for more information, see
34 //~| HELP: add a dummy let to cause `t` to be fully captured
40 closure_contains_block();
41 closure_doesnt_contain_block();