2020-05-20 17:58:41 +00:00
|
|
|
error[E0521]: borrowed data escapes outside of closure
|
|
|
|
--> $DIR/regions-escape-unboxed-closure.rs:5:23
|
2018-01-15 18:55:10 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let mut x: Option<&isize> = None;
|
2020-05-20 17:58:41 +00:00
|
|
|
| ----- `x` declared here, outside of the closure body
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | with_int(&mut |y| x = Some(y));
|
2020-05-20 17:58:41 +00:00
|
|
|
| - ^^^^^^^^^^^ `y` escapes the closure body here
|
|
|
|
| |
|
|
|
|
| `y` is a reference that is only valid in the closure body
|
2018-01-15 18:55:10 +00:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2021-02-01 17:23:12 +00:00
|
|
|
For more information about this error, try `rustc --explain E0521`.
|