error[E0521]: borrowed data escapes outside of closure
  --> $DIR/issue-45983.rs:19: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:19: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