2020-05-20 12:58:41 -05:00
|
|
|
fn with_int(f: &mut dyn FnMut(&isize)) {}
|
2014-11-18 15:13:24 -06:00
|
|
|
|
|
|
|
fn main() {
|
2015-01-08 04:54:35 -06:00
|
|
|
let mut x: Option<&isize> = None;
|
2018-01-03 17:54:33 -06:00
|
|
|
with_int(&mut |y| x = Some(y));
|
2020-05-20 12:58:41 -05:00
|
|
|
//~^ ERROR borrowed data escapes outside of closure
|
2014-11-18 15:13:24 -06:00
|
|
|
}
|