summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/trait-upcasting/issue-11515.rs
blob: 31ea2fb353cd22a1e2b74d5f4209fe4601a20951 (plain)
1
2
3
4
5
6
7
8
9
10
11
// revisions: current next
//[next] compile-flags: -Znext-solver

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

fn main() {
    let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
    let test = Box::new(Test { func: closure }); //~ ERROR trait upcasting coercion is experimental [E0658]
}