]>
Commit | Line | Data |
---|---|---|
ba9703b0 XL |
1 | An identifier that is neither defined nor a struct was used. |
2 | ||
60c5eb7d XL |
3 | Erroneous code example: |
4 | ||
5 | ```compile_fail,E0422 | |
6 | fn main () { | |
7 | let x = Foo { x: 1, y: 2 }; | |
8 | } | |
9 | ``` | |
10 | ||
11 | In this case, `Foo` is undefined, so it inherently isn't anything, and | |
12 | definitely not a struct. | |
13 | ||
14 | ```compile_fail | |
15 | fn main () { | |
16 | let foo = 1; | |
17 | let x = foo { x: 1, y: 2 }; | |
18 | } | |
19 | ``` | |
20 | ||
21 | In this case, `foo` is defined, but is not a struct, so Rust can't use it as | |
22 | one. |