File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,29 @@ match Something::NotFoo {
609609```
610610"## ,
611611
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+
612635E0423 : r##"
613636A `struct` variant name was used like a function name. Example of
614637erroneous code:
@@ -888,7 +911,6 @@ register_diagnostics! {
888911 E0418 , // is not an enum variant, struct or const
889912 E0420 , // is not an associated const
890913 E0421 , // unresolved associated const
891- E0422 , // does not name a structure
892914 E0427 , // cannot use `ref` binding mode with ...
893915 E0429 , // `self` imports are only allowed within a { } list
894916 E0434 , // can't capture dynamic environment in a fn item
You can’t perform that action at this time.
0 commit comments