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

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]
}