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