2019-01-27 05:03:21 -06:00
|
|
|
error[E0521]: borrowed data escapes outside of closure
|
2020-05-20 12:58:41 -05:00
|
|
|
--> $DIR/issue-45983.rs:10:18
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
|
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));
|
2019-01-27 05:03:21 -06:00
|
|
|
| - ^^^^^^^^^^^ `y` escapes the closure body here
|
|
|
|
| |
|
|
|
|
| `y` is a reference that is only valid in the closure body
|
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2019-01-27 05:03:21 -06:00
|
|
|
|
2021-02-01 11:23:12 -06:00
|
|
|
For more information about this error, try `rustc --explain E0521`.
|