blob: 2b3a9816e454df8cc2c227395f978e48477122e7 [file] [log] [blame]
error[E0521]: borrowed data escapes outside of closure
--> $DIR/regions-escape-bound-fn.rs:8:18
|
LL | let mut x: Option<&isize> = None;
| ----- `x` is declared here, outside of the closure body
LL | with_int(|y| x = Some(y));
| - ^^^^^^^^^^^ `y` escapes the closure body here
| |
| `y` is a reference that is only valid in the closure body
error: aborting due to previous error