]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-45983.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-45983.stderr
1 error[E0521]: borrowed data escapes outside of closure
2   --> $DIR/issue-45983.rs:10:18
3    |
4 LL |     let mut x = None;
5    |         ----- `x` declared here, outside of the closure body
6 LL |     give_any(|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
13 For more information about this error, try `rustc --explain E0521`.