rust/tests/ui/borrowck/regions-escape-unboxed-closure.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
551 B
Plaintext
Raw Normal View History

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-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
error: aborting due to 1 previous error
2021-02-01 17:23:12 +00:00
For more information about this error, try `rustc --explain E0521`.