2017-08-19 09:38:36 -05:00
|
|
|
// miri issue #304
|
|
|
|
fn main() {
|
|
|
|
let mut y = 0;
|
|
|
|
{
|
|
|
|
let mut box_maybe_closure = Box::new(None);
|
2022-06-20 17:43:42 -05:00
|
|
|
*box_maybe_closure = Some(|| y += 1);
|
2017-08-19 09:38:36 -05:00
|
|
|
(box_maybe_closure.unwrap())();
|
|
|
|
}
|
|
|
|
assert_eq!(y, 1);
|
|
|
|
}
|