2020-05-20 12:58:41 -05:00
|
|
|
error[E0521]: borrowed data escapes outside of closure
|
|
|
|
--> $DIR/issue-7573.rs:17:9
|
2018-01-15 12:55:10 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
|
2020-05-20 12:58:41 -05:00
|
|
|
| ---------------- `lines_to_use` declared here, outside of the closure body
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | let push_id = |installed_id: &CrateId| {
|
2020-05-20 12:58:41 -05:00
|
|
|
| ------------ `installed_id` is a reference that is only valid in the closure body
|
|
|
|
LL |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | lines_to_use.push(installed_id);
|
2020-05-20 12:58:41 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `installed_id` escapes the closure body here
|
2018-01-15 12:55:10 -06:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2021-02-01 11:23:12 -06:00
|
|
|
For more information about this error, try `rustc --explain E0521`.
|