]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/regions-escape-unboxed-closure.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[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 }