rust/tests/ui/traits/trait-upcasting/issue-11515.rs
2023-12-14 15:22:37 +01:00

13 lines
258 B
Rust

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