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