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