]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0164.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0164.md
1 This error means that an attempt was made to match a struct type enum
2 variant as a non-struct type:
3
4 ```compile_fail,E0164
5 enum Foo { B { i: u32 } }
6
7 fn bar(foo: Foo) -> u32 {
8 match foo {
9 Foo::B(i) => i, // error E0164
10 }
11 }
12 ```
13
14 Try using `{}` instead:
15
16 ```
17 enum Foo { B { i: u32 } }
18
19 fn bar(foo: Foo) -> u32 {
20 match foo {
21 Foo::B{i} => i,
22 }
23 }
24 ```