diff options
Diffstat (limited to 'tests/ui/traits/trait-upcasting/issue-11515.rs')
-rw-r--r-- | tests/ui/traits/trait-upcasting/issue-11515.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/traits/trait-upcasting/issue-11515.rs b/tests/ui/traits/trait-upcasting/issue-11515.rs new file mode 100644 index 000000000..723f3a24f --- /dev/null +++ b/tests/ui/traits/trait-upcasting/issue-11515.rs @@ -0,0 +1,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] +} |