rust/tests/ui/borrowck/issue-7573.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
649 B
Plaintext
Raw Normal View History

2020-05-20 12:58:41 -05:00
error[E0521]: borrowed data escapes outside of closure
--> $DIR/issue-7573.rs:17:9
|
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
error: aborting due to 1 previous error
2021-02-01 11:23:12 -06:00
For more information about this error, try `rustc --explain E0521`.