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