rust/src/test/ui/borrowck/issue-7573.stderr

17 lines
691 B
Plaintext
Raw Normal View History

error: borrowed data cannot be stored outside of its closure
--> $DIR/issue-7573.rs:32:27
|
2018-02-23 03:42:32 +03:00
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
| - cannot infer an appropriate lifetime...
2018-02-25 02:01:39 +03:00
LL | //~^ NOTE cannot infer an appropriate lifetime
2018-02-23 03:42:32 +03:00
LL | let push_id = |installed_id: &CrateId| {
| ------- ------------------------ borrowed data cannot outlive this closure
| |
| ...so that variable is valid at time of its declaration
...
2018-02-23 03:42:32 +03:00
LL | lines_to_use.push(installed_id);
| ^^^^^^^^^^^^ cannot be stored outside of its closure
error: aborting due to previous error