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) {
746746```
747747"## ,
748748
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+
749781E0072 : r##"
750782When defining a recursive struct or enum, any use of the type being defined
751783from inside the definition must occur behind a pointer (like `Box` or `&`).
@@ -1505,7 +1537,6 @@ register_diagnostics! {
15051537 E0035 , // does not take type parameters
15061538 E0036 , // incorrect number of type parameters given for this method
15071539 E0068 ,
1508- E0071 ,
15091540 E0074 ,
15101541 E0075 ,
15111542 E0076 ,
You can’t perform that action at this time.
0 commit comments