8
8
| -
9
9
| |
10
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<'_>>`
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
12
14
13
15
error[E0597]: `o3` does not live long enough
14
16
--> $DIR/dropck_trait_cycle_checked.rs:112:13
20
22
| -
21
23
| |
22
24
| `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
24
28
25
29
error[E0597]: `o2` does not live long enough
26
30
--> $DIR/dropck_trait_cycle_checked.rs:113:13
@@ -38,7 +42,7 @@ error[E0597]: `o3` does not live long enough
38
42
--> $DIR/dropck_trait_cycle_checked.rs:114:13
39
43
|
40
44
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`
45
+ | -------- cast requires that `o3` is borrowed for `'static`
42
46
...
43
47
LL | o2.set1(&o3);
44
48
| ^^^ borrowed value does not live long enough
@@ -62,7 +66,7 @@ error[E0597]: `o2` does not live long enough
62
66
--> $DIR/dropck_trait_cycle_checked.rs:116:13
63
67
|
64
68
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`
69
+ | -------- cast requires that `o2` is borrowed for `'static`
66
70
...
67
71
LL | o3.set1(&o2);
68
72
| ^^^ borrowed value does not live long enough
0 commit comments