|
| 1 | +error[E0597]: `o2` does not live long enough |
| 2 | + --> $DIR/dropck_trait_cycle_checked.rs:111:13 |
| 3 | + | |
| 4 | +LL | o1.set0(&o2); |
| 5 | + | ^^^ borrowed value does not live long enough |
| 6 | +... |
| 7 | +LL | } |
| 8 | + | - |
| 9 | + | | |
| 10 | + | `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<'_>>` |
| 12 | + |
| 13 | +error[E0597]: `o3` does not live long enough |
| 14 | + --> $DIR/dropck_trait_cycle_checked.rs:112:13 |
| 15 | + | |
| 16 | +LL | o1.set1(&o3); |
| 17 | + | ^^^ borrowed value does not live long enough |
| 18 | +... |
| 19 | +LL | } |
| 20 | + | - |
| 21 | + | | |
| 22 | + | `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<'_>>` |
| 24 | + |
| 25 | +error[E0597]: `o2` does not live long enough |
| 26 | + --> $DIR/dropck_trait_cycle_checked.rs:113:13 |
| 27 | + | |
| 28 | +LL | let (o1, o2, o3): (Box<dyn Obj>, Box<dyn Obj>, Box<dyn Obj>) = (O::new(), O::new(), O::new()); |
| 29 | + | -------- cast requires that `o2` is borrowed for `'static` |
| 30 | +... |
| 31 | +LL | o2.set0(&o2); |
| 32 | + | ^^^ borrowed value does not live long enough |
| 33 | +... |
| 34 | +LL | } |
| 35 | + | - `o2` dropped here while still borrowed |
| 36 | + |
| 37 | +error[E0597]: `o3` does not live long enough |
| 38 | + --> $DIR/dropck_trait_cycle_checked.rs:114:13 |
| 39 | + | |
| 40 | +LL | 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` |
| 42 | +... |
| 43 | +LL | o2.set1(&o3); |
| 44 | + | ^^^ borrowed value does not live long enough |
| 45 | +... |
| 46 | +LL | } |
| 47 | + | - `o3` dropped here while still borrowed |
| 48 | + |
| 49 | +error[E0597]: `o1` does not live long enough |
| 50 | + --> $DIR/dropck_trait_cycle_checked.rs:115:13 |
| 51 | + | |
| 52 | +LL | o3.set0(&o1); |
| 53 | + | ^^^ borrowed value does not live long enough |
| 54 | +LL | o3.set1(&o2); |
| 55 | +LL | } |
| 56 | + | - |
| 57 | + | | |
| 58 | + | `o1` dropped here while still borrowed |
| 59 | + | borrow might be used here, when `o1` is dropped and runs the destructor for type `std::boxed::Box<dyn Obj<'_>>` |
| 60 | + |
| 61 | +error[E0597]: `o2` does not live long enough |
| 62 | + --> $DIR/dropck_trait_cycle_checked.rs:116:13 |
| 63 | + | |
| 64 | +LL | 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` |
| 66 | +... |
| 67 | +LL | o3.set1(&o2); |
| 68 | + | ^^^ borrowed value does not live long enough |
| 69 | +LL | } |
| 70 | + | - `o2` dropped here while still borrowed |
| 71 | + |
| 72 | +error: aborting due to 6 previous errors |
| 73 | + |
| 74 | +For more information about this error, try `rustc --explain E0597`. |
0 commit comments