2021-07-25 05:43:48 -05:00
|
|
|
// run-pass
|
|
|
|
|
|
|
|
struct Test {
|
|
|
|
func: Box<dyn FnMut() + 'static>,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
|
2021-08-24 19:39:40 -05:00
|
|
|
let mut test = Box::new(Test { func: closure });
|
2021-07-25 05:43:48 -05:00
|
|
|
(test.func)();
|
|
|
|
}
|