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

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

14 lines
497 B
Plaintext
Raw Normal View History

error[E0521]: borrowed data escapes outside of closure
2020-05-20 17:58:41 +00:00
--> $DIR/issue-45983.rs:10:18
|
LL | let mut x = None;
2020-01-24 20:52:16 +00:00
| ----- `x` declared here, outside of the closure body
2020-05-20 17:58:41 +00:00
LL | give_any(|y| x = Some(y));
| - ^^^^^^^^^^^ `y` escapes the closure body here
| |
| `y` is a reference that is only valid in the closure body
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`.