88 | -
99 | |
1010 | `o2` dropped here while still borrowed
11- | borrow might be used here, when `o2` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
11+ | borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
12+ |
13+ = note: values in a scope are dropped in the opposite order they are defined
1214
1315error[E0597]: `o3` does not live long enough
1416 --> $DIR/dropck_trait_cycle_checked.rs:112:13
2022 | -
2123 | |
2224 | `o3` dropped here while still borrowed
23- | borrow might be used here, when `o3` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
25+ | borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>`
26+ |
27+ = note: values in a scope are dropped in the opposite order they are defined
2428
2529error[E0597]: `o2` does not live long enough
2630 --> $DIR/dropck_trait_cycle_checked.rs:113:13
@@ -38,7 +42,7 @@ error[E0597]: `o3` does not live long enough
3842 --> $DIR/dropck_trait_cycle_checked.rs:114:13
3943 |
4044LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
41- | -------- cast requires that `o3` is borrowed for `'static`
45+ | -------- cast requires that `o3` is borrowed for `'static`
4246...
4347LL | o2.set1(&o3);
4448 | ^^^ borrowed value does not live long enough
@@ -62,7 +66,7 @@ error[E0597]: `o2` does not live long enough
6266 --> $DIR/dropck_trait_cycle_checked.rs:116:13
6367 |
6468LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new());
65- | -------- cast requires that `o2` is borrowed for `'static`
69+ | -------- cast requires that `o2` is borrowed for `'static`
6670...
6771LL | o3.set1(&o2);
6872 | ^^^ borrowed value does not live long enough
0 commit comments