3 // revisions: twenty_eighteen twenty_twentyone
4 // [twenty_eighteen]compile-flags: --edition 2018
5 // [twenty_twentyone]compile-flags: --edition 2021
8 struct Dropable(&'static str);
10 impl Drop for Dropable {
12 println!("Dropping {}", self.0)
35 let a = A { x: Dropable("x"), y: Dropable("y") };
37 let c = move || println!("{:?} {:?}", a.y, a.x);
42 c: A { x: Dropable("b.c.x"), y: Dropable("b.c.y") },
43 d: A { x: Dropable("b.d.x"), y: Dropable("b.d.y") },
46 let d = move || println!("{:?} {:?} {:?} {:?}", b.d.y, b.d.x, b.c.y, b.c.x);
51 c: &A { x: Dropable("r.c.x"), y: Dropable("r.c.y") },
52 d: &A { x: Dropable("r.d.x"), y: Dropable("r.d.y") },
55 let e = move || println!("{:?} {:?} {:?} {:?}", r.d.y, r.d.x, r.c.y, r.c.x);