]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-unboxed-closure.rs
d8bef927fd722f4a853cdcb73c182cdaabeb5159
[rust.git] / src / test / ui / borrowck / regions-escape-unboxed-closure.rs
1 fn with_int(f: &mut dyn FnMut(&isize)) {
2 }
3
4 fn main() {
5     let mut x: Option<&isize> = None;
6     with_int(&mut |y| x = Some(y));
7     //~^ ERROR borrowed data cannot be stored outside of its closure
8 }