]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/dropck.nll.stderr
Auto merge of #52841 - petrochenkov:premacro, r=alexcrichton
[rust.git] / src / test / ui / generator / dropck.nll.stderr
1 error[E0597]: `*cell` does not live long enough
2   --> $DIR/dropck.rs:19:40
3    |
4 LL |     let ref_ = Box::leak(Box::new(Some(cell.borrow_mut())));
5    |                                        ^^^^ borrowed value does not live long enough
6 ...
7 LL | }
8    | -
9    | |
10    | `*cell` dropped here while still borrowed
11    | borrow later used here, when `gen` is dropped
12
13 error[E0597]: `ref_` does not live long enough
14   --> $DIR/dropck.rs:22:11
15    |
16 LL |       gen = || {
17    |  ___________^
18 LL | |         // but the generator can use it to drop a `Ref<'a, i32>`.
19 LL | |         let _d = ref_.take(); //~ ERROR `ref_` does not live long enough
20 LL | |         yield;
21 LL | |     };
22    | |_____^ borrowed value does not live long enough
23 ...
24 LL |   }
25    |   -
26    |   |
27    |   `ref_` dropped here while still borrowed
28    |   borrow later used here, when `gen` is dropped
29    |
30    = note: values in a scope are dropped in the opposite order they are defined
31
32 error: aborting due to 2 previous errors
33
34 For more information about this error, try `rustc --explain E0597`.