Skip to content

Commit 292d5c1

Browse files
committed
Bless output of test generator/ref-escapes-but-not-over-yield.rs for Polonius
1 parent c5a1bc1 commit 292d5c1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0597]: `b` does not live long enough
2+
--> $DIR/ref-escapes-but-not-over-yield.rs:11:13
3+
|
4+
LL | let mut b = move || {
5+
| _________________-
6+
LL | | yield();
7+
LL | | let b = 5;
8+
LL | | a = &b;
9+
| | ^^ borrowed value does not live long enough
10+
LL | |
11+
LL | | };
12+
| | -
13+
| | |
14+
| | `b` dropped here while still borrowed
15+
| |_____... and the borrow might be used here, when that temporary is dropped and runs the destructor for generator
16+
| a temporary with access to the borrow is created here ...
17+
18+
error: aborting due to previous error
19+
20+
For more information about this error, try `rustc --explain E0597`.

0 commit comments

Comments
 (0)