]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-unboxed-closure.rs
Rollup merge of #102488 - compiler-errors:gat-compatibility, r=oli-obk
[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 }