File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -746,6 +746,38 @@ fn some_func(x: &mut i32) {
746
746
```
747
747
"## ,
748
748
749
+ E0071 : r##"
750
+ You tried to use a structure initialization with a non-structure type.
751
+ Example of erroneous code:
752
+
753
+ ```
754
+ enum Foo { f };
755
+
756
+ let u = Foo::f { value: 0i32 }; // error: Foo:f isn't a structure!
757
+ // or even more simple:
758
+ let u = t { random_field: 0i32 }; //error: t isn't a structure!
759
+ ```
760
+
761
+ To fix this error, please declare the structure with the given name
762
+ first:
763
+
764
+ ```
765
+ struct Inner {
766
+ value: i32
767
+ }
768
+
769
+ enum Foo {
770
+ f(Inner)
771
+ }
772
+
773
+ fn main() {
774
+ let u = Foo::f(Inner { value: 0i32 });
775
+ // or even more simple:
776
+ let t = Inner { value: 0i32 };
777
+ }
778
+ ```
779
+ "## ,
780
+
749
781
E0072 : r##"
750
782
When defining a recursive struct or enum, any use of the type being defined
751
783
from inside the definition must occur behind a pointer (like `Box` or `&`).
@@ -1505,7 +1537,6 @@ register_diagnostics! {
1505
1537
E0035 , // does not take type parameters
1506
1538
E0036 , // incorrect number of type parameters given for this method
1507
1539
E0068 ,
1508
- E0071 ,
1509
1540
E0074 ,
1510
1541
E0075 ,
1511
1542
E0076 ,
You can’t perform that action at this time.
0 commit comments