]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0422.md
New upstream version 1.68.2+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0422.md
CommitLineData
ba9703b0
XL
1An identifier that is neither defined nor a struct was used.
2
60c5eb7d
XL
3Erroneous code example:
4
5```compile_fail,E0422
6fn main () {
7 let x = Foo { x: 1, y: 2 };
8}
9```
10
11In this case, `Foo` is undefined, so it inherently isn't anything, and
12definitely not a struct.
13
14```compile_fail
15fn main () {
16 let foo = 1;
17 let x = foo { x: 1, y: 2 };
18}
19```
20
21In this case, `foo` is defined, but is not a struct, so Rust can't use it as
22one.