summary refs log tree commit diff
path: root/src/test/ui/generator/borrowing.nll.stderr
blob: 243e9018585138442786b9830af0e71b0b978069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
error[E0597]: `a` does not live long enough
  --> $DIR/borrowing.rs:18:18
   |
LL |         unsafe { (|| yield &a).resume() }
   |                  ^^^^^^^^^^^^^
   |                  |
   |                  borrowed value does not live long enough
   |                  borrow may end up in a temporary, created here
LL |         //~^ ERROR: `a` does not live long enough
LL |     };
   |     -- temporary later dropped here, potentially using the reference
   |     |
   |     borrowed value only lives until here

error[E0597]: `a` does not live long enough
  --> $DIR/borrowing.rs:24:9
   |
LL | /         || {
LL | |             yield &a
LL | |             //~^ ERROR: `a` does not live long enough
LL | |         }
   | |_________^ borrowed value does not live long enough
LL |       };
   |       - borrowed value only lives until here
LL |   }
   |   - borrow later used here, when `_b` is dropped

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0597`.