rust/tests/run-pass/closure-field-ty.rs
2017-08-24 13:34:05 +02:00

11 lines
229 B
Rust

// miri issue #304
fn main() {
let mut y = 0;
{
let mut box_maybe_closure = Box::new(None);
*box_maybe_closure = Some(|| { y += 1; });
(box_maybe_closure.unwrap())();
}
assert_eq!(y, 1);
}