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