blob: 772df3e6c58229e1c6b95383d508f1cee0649625 [file] [log] [blame]
fn with_int<F>(f: F) where F: FnOnce(&isize) {
let x = 3;
f(&x);
}
fn main() {
let mut x: Option<&isize> = None;
with_int(|y| x = Some(y));
//~^ ERROR borrowed data cannot be stored outside of its closure
}