]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr
Omit 'missing IndexMut impl' suggestion when IndexMut is implemented.
[rust.git] / src / test / ui / borrowck / regions-escape-bound-fn-2.nll.stderr
1 warning: not reporting region error due to nll
2   --> $DIR/regions-escape-bound-fn-2.rs:18:27
3    |
4 LL |     with_int(|y| x = Some(y));
5    |                           ^
6
7 error: borrowed data escapes outside of closure
8   --> $DIR/regions-escape-bound-fn-2.rs:18:18
9    |
10 LL |     let mut x = None;
11    |         ----- `x` is declared here, outside of the closure body
12 LL |     with_int(|y| x = Some(y));
13    |               -  ^^^^^^^^^^^ `y` escapes the closure body here
14    |               |
15    |               `y` is a reference that is only valid in the closure body
16
17 error: aborting due to previous error
18