1 error: borrowed data escapes outside of closure
2 --> $DIR/issue-45983.rs:36:18
5 | - `x` is declared here, outside of the closure body
6 LL | give_any(|y| x = Some(y));
7 | - ^^^^^^^^^^^ `y` escapes the closure body here
9 | `y` is a reference that is only valid in the closure body
11 error[E0594]: cannot assign to `x`, as it is not declared as mutable
12 --> $DIR/issue-45983.rs:36:18
15 | - help: consider changing this to be mutable: `mut x`
16 LL | give_any(|y| x = Some(y));
17 | ^^^^^^^^^^^ cannot assign
19 error: aborting due to 2 previous errors
21 For more information about this error, try `rustc --explain E0594`.