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 Permalink Normal View History

error[E0521]: borrowed data escapes outside of closure
2020-05-20 12:58:41 -05:00
--> $DIR/issue-45983.rs:10:18
|
LL | let mut x = None;
2020-01-24 14:52:16 -06:00
| ----- `x` declared here, outside of the closure body
2020-05-20 12:58:41 -05: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 11:23:12 -06:00
For more information about this error, try `rustc --explain E0521`.