2021-07-25 18:43:48 +08:00
|
|
|
// run-pass
|
2021-08-25 02:39:40 +02:00
|
|
|
#![feature(trait_upcasting)]
|
2021-07-25 18:43:48 +08:00
|
|
|
|
|
|
|
struct Test {
|
|
|
|
func: Box<dyn FnMut() + 'static>,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
|
2021-08-25 02:39:40 +02:00
|
|
|
let mut test = Box::new(Test { func: closure });
|
2021-07-25 18:43:48 +08:00
|
|
|
(test.func)();
|
|
|
|
}
|