rust/tests/ui/traits/trait-upcasting/issue-11515.rs
Urgau 4c2d6de70e Stabilize RFC3324 dyn upcasting coercion
Aka trait_upcasting feature.

And also adjust the `deref_into_dyn_supertrait` lint.
2023-11-22 13:56:36 +01:00

13 lines
264 B
Rust

// check-pass
// 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 });
}