]>
Commit | Line | Data |
---|---|---|
83c7162d | 1 | error[E0597]: `*cell` does not live long enough |
9fa01778 | 2 | --> $DIR/dropck.rs:10:40 |
83c7162d XL |
3 | | |
4 | LL | let ref_ = Box::leak(Box::new(Some(cell.borrow_mut()))); | |
c295e0f8 | 5 | | ^^^^^^^^^^^^^^^^^ borrowed value does not live long enough |
83c7162d XL |
6 | ... |
7 | LL | } | |
48663c56 XL |
8 | | - |
9 | | | | |
10 | | `*cell` dropped here while still borrowed | |
11 | | borrow might be used here, when `gen` is dropped and runs the destructor for generator | |
83c7162d | 12 | | |
48663c56 | 13 | = note: values in a scope are dropped in the opposite order they are defined |
83c7162d | 14 | |
2c00a5a8 | 15 | error[E0597]: `ref_` does not live long enough |
9fa01778 | 16 | --> $DIR/dropck.rs:15:18 |
2c00a5a8 | 17 | | |
0531ce1d | 18 | LL | gen = || { |
48663c56 | 19 | | -- value captured here by generator |
0531ce1d | 20 | LL | // but the generator can use it to drop a `Ref<'a, i32>`. |
532ac7d7 | 21 | LL | let _d = ref_.take(); |
2c00a5a8 XL |
22 | | ^^^^ borrowed value does not live long enough |
23 | ... | |
0531ce1d | 24 | LL | } |
48663c56 XL |
25 | | - |
26 | | | | |
27 | | `ref_` dropped here while still borrowed | |
28 | | borrow might be used here, when `gen` is dropped and runs the destructor for generator | |
2c00a5a8 | 29 | | |
48663c56 | 30 | = note: values in a scope are dropped in the opposite order they are defined |
2c00a5a8 | 31 | |
83c7162d | 32 | error: aborting due to 2 previous errors |
2c00a5a8 | 33 | |
0531ce1d | 34 | For more information about this error, try `rustc --explain E0597`. |