]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/regions-escape-unboxed-closure.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / regions-escape-unboxed-closure.rs
1 fn with_int(f: &mut dyn FnMut(&isize)) {}
2
3 fn main() {
4     let mut x: Option<&isize> = None;
5     with_int(&mut |y| x = Some(y));
6     //~^ ERROR borrowed data escapes outside of closure
7 }