]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / traits / trait-upcasting / issue-11515-upcast-fn_mut-fn.rs
1 // run-pass
2 #![feature(trait_upcasting)]
3
4 struct Test {
5     func: Box<dyn FnMut() + 'static>,
6 }
7
8 fn main() {
9     let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
10     let mut test = Box::new(Test { func: closure });
11     (test.func)();
12 }