rust/src/test/ui/borrowck/regions-escape-unboxed-closure.rs
2019-05-29 00:57:31 -04:00

9 lines
201 B
Rust

fn with_int(f: &mut dyn 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
}