about summary refs log tree commit diff
path: root/tests/ui/box/issue-82446.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/box/issue-82446.rs')
-rw-r--r--tests/ui/box/issue-82446.rs15
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 00000000000..2960f7fbc21
--- /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() {}