2017-05-27 12:58:52 -05:00
|
|
|
error[E0597]: `*x` does not live long enough
|
2016-10-26 11:10:39 -05:00
|
|
|
--> $DIR/regions-infer-borrow-scope-within-loop.rs:28:5
|
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
24 | y = borrow(&*x);
|
2016-10-26 11:10:39 -05:00
|
|
|
| -- borrow occurs here
|
|
|
|
...
|
2017-11-20 06:13:27 -06:00
|
|
|
28 | } //~ ERROR `*x` does not live long enough
|
2016-10-26 11:10:39 -05:00
|
|
|
| ^ `*x` dropped here while still borrowed
|
|
|
|
29 | assert!(*y != 0);
|
|
|
|
30 | }
|
|
|
|
| - borrowed value needs to live until here
|
|
|
|
|
2017-07-02 05:49:30 -05:00
|
|
|
error: aborting due to previous error
|
2016-10-26 11:10:39 -05:00
|
|
|
|