File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ E0019: include_str!("./error_codes/E0019.md"),
2828E0020 : include_str!( "./error_codes/E0020.md" ) ,
2929E0022 : include_str!( "./error_codes/E0022.md" ) ,
3030E0023 : include_str!( "./error_codes/E0023.md" ) ,
31+ E0024 : include_str!( "./error_codes/E0024.md" ) ,
3132E0025 : include_str!( "./error_codes/E0025.md" ) ,
3233E0026 : include_str!( "./error_codes/E0026.md" ) ,
3334E0027 : include_str!( "./error_codes/E0027.md" ) ,
Original file line number Diff line number Diff line change 1+ #### Note: this error code is no longer emitted by the compiler.
2+
3+ This error indicates that a pattern attempted to extract the fields of an enum
4+ variant with no fields. Here's a tiny example of this error:
5+
6+ ``` compile_fail,E0532
7+ // This enum has two variants.
8+ enum Number {
9+ // This variant has no fields.
10+ Zero,
11+ // This variant has one field.
12+ One(u32)
13+ }
14+
15+ // Assuming x is a Number we can pattern match on its contents.
16+ match Number::Zero {
17+ Number::Zero(inside) => {}
18+ Number::One(inside) => {}
19+ }
20+ ```
21+
22+ The pattern match ` Zero(inside) ` is incorrect because the ` Zero ` variant
23+ contains no fields, yet the ` inside ` name attempts to bind the first field of
24+ the enum.
You can’t perform that action at this time.
0 commit comments