We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 327caac commit 7228e9bCopy full SHA for 7228e9b
src/test/ui/box/issue-82446.rs
@@ -0,0 +1,15 @@
1
+// https://github.com/rust-lang/rust/issues/82446
2
+// Spurious 'help: store this in the heap' regression test
3
+trait MyTrait {}
4
+
5
+struct Foo {
6
+ val: Box<dyn MyTrait>
7
+}
8
9
+fn make_it(val: &Box<dyn MyTrait>) {
10
+ Foo {
11
+ val //~ ERROR [E0308]
12
+ };
13
14
15
+fn main() {}
src/test/ui/box/issue-82446.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-82446.rs:11:9
+ |
+LL | val
+ | ^^^ expected struct `Box`, found reference
+ = note: expected struct `Box<(dyn MyTrait + 'static)>`
+ found reference `&Box<(dyn MyTrait + 'static)>`
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
0 commit comments