2017-05-27 19:58:52 +02:00
|
|
|
error[E0597]: `c` does not live long enough
|
2016-10-26 19:10:39 +03:00
|
|
|
--> $DIR/regionck-unboxed-closure-lifetimes.rs:19:5
|
|
|
|
|
|
2017-11-20 13:13:27 +01:00
|
|
|
17 | let c_ref = &c;
|
2016-10-26 19:10:39 +03:00
|
|
|
| - borrow occurs here
|
|
|
|
18 | f = move |a: isize, b: isize| { a + b + *c_ref };
|
2017-11-20 13:13:27 +01:00
|
|
|
19 | } //~ ERROR `c` does not live long enough
|
2016-10-26 19:10:39 +03:00
|
|
|
| ^ `c` dropped here while still borrowed
|
|
|
|
20 | }
|
|
|
|
| - borrowed value needs to live until here
|
|
|
|
|
2017-07-02 13:49:30 +03:00
|
|
|
error: aborting due to previous error
|
2016-10-26 19:10:39 +03:00
|
|
|
|