]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr
68a0fe0b4f07b7d5a965488381c7ff19b683e265
[rust.git] / src / test / ui / borrowck / regions-escape-bound-fn-2.nll.stderr
1 error[E0521]: borrowed data escapes outside of closure
2   --> $DIR/regions-escape-bound-fn-2.rs:8:18
3    |
4 LL |     let mut x = None;
5    |         ----- `x` declared here, outside of the closure body
6 LL |     with_int(|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
11 error: aborting due to previous error
12