rust/src/test/ui/borrowck/regions-escape-unboxed-closure.rs
2018-12-25 21:08:33 -07:00

9 lines
197 B
Rust

fn with_int(f: &mut FnMut(&isize)) {
}
fn main() {
let mut x: Option<&isize> = None;
with_int(&mut |y| x = Some(y));
//~^ ERROR borrowed data cannot be stored outside of its closure
}