File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,29 @@ match Something::NotFoo {
609
609
```
610
610
"## ,
611
611
612
+ E0422 : r##"
613
+ You are trying to use an identifier that is either undefined or not a
614
+ struct. For instance:
615
+ ```
616
+ fn main () {
617
+ let x = Foo { x: 1, y: 2 };
618
+ }
619
+ ```
620
+
621
+ In this case, `Foo` is undefined, so it inherently isn't anything, and
622
+ definitely not a struct.
623
+
624
+ ```
625
+ fn main () {
626
+ let foo = 1;
627
+ let x = foo { x: 1, y: 2 };
628
+ }
629
+ ```
630
+
631
+ In this case, `foo` is defined, but is not a struct, so Rust can't use
632
+ it as one.
633
+ "## ,
634
+
612
635
E0423 : r##"
613
636
A `struct` variant name was used like a function name. Example of
614
637
erroneous code:
@@ -888,7 +911,6 @@ register_diagnostics! {
888
911
E0418 , // is not an enum variant, struct or const
889
912
E0420 , // is not an associated const
890
913
E0421 , // unresolved associated const
891
- E0422 , // does not name a structure
892
914
E0427 , // cannot use `ref` binding mode with ...
893
915
E0429 , // `self` imports are only allowed within a { } list
894
916
E0434 , // can't capture dynamic environment in a fn item
You can’t perform that action at this time.
0 commit comments