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