diff options
Diffstat (limited to 'tests/ui/type/issue-58355.rs')
-rw-r--r-- | tests/ui/type/issue-58355.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/type/issue-58355.rs b/tests/ui/type/issue-58355.rs new file mode 100644 index 000000000..3b62fdece --- /dev/null +++ b/tests/ui/type/issue-58355.rs @@ -0,0 +1,7 @@ +#![crate_type = "lib"] + +pub fn foo(callback: fn() -> dyn ToString) { + let mut x: Option<Box<dyn Fn() -> dyn ToString>> = None; + x = Some(Box::new(callback)); + //~^ ERROR: the size for values of type `dyn ToString` cannot be known at compilation time +} |