diff options
Diffstat (limited to 'tests/ui/box/issue-82446.rs')
-rw-r--r-- | tests/ui/box/issue-82446.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/box/issue-82446.rs b/tests/ui/box/issue-82446.rs new file mode 100644 index 000000000..2960f7fbc --- /dev/null +++ b/tests/ui/box/issue-82446.rs @@ -0,0 +1,15 @@ +// https://github.com/rust-lang/rust/issues/82446 +// Spurious 'help: store this in the heap' regression test +trait MyTrait {} + +struct Foo { + val: Box<dyn MyTrait> +} + +fn make_it(val: &Box<dyn MyTrait>) { + Foo { + val //~ ERROR [E0308] + }; +} + +fn main() {} |