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