]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-unboxed-closure.rs
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
[rust.git] / src / test / 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 }