warning: not reporting region error due to nll --> $DIR/issue-45983.rs:17:27 | LL | give_any(|y| x = Some(y)); | ^ error: borrowed data escapes outside of closure --> $DIR/issue-45983.rs:17:18 | LL | let x = None; | - `x` is declared here, outside of the closure body 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[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-45983.rs:17:18 | LL | let x = None; | - help: consider changing this to be mutable: `mut x` LL | give_any(|y| x = Some(y)); | ^^^^^^^^^^^ cannot assign error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0594`.