summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs
blob: b672963ae98876c5e4553a6e3b2be7bbb9771787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass
#![feature(trait_upcasting)]

struct Test {
    func: Box<dyn FnMut() + 'static>,
}

fn main() {
    let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
    let mut test = Box::new(Test { func: closure });
    (test.func)();
}