2015-01-07 20:53:58 -06:00
|
|
|
#![feature(box_syntax)]
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
struct Test {
|
2021-07-25 05:43:48 -05:00
|
|
|
func: Box<dyn FnMut() + 'static>,
|
2014-04-27 22:27:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-05-28 13:46:13 -05:00
|
|
|
let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
|
2021-07-25 05:43:48 -05:00
|
|
|
let test = box Test { func: closure }; //~ ERROR trait upcasting coercion is experimental [E0658]
|
2014-04-27 22:27:20 -05:00
|
|
|
}
|