E0252
A named field matched without its label (Shape.Circle(r)) or with the wrong one, or a label on a positional field.
Machine-applicable fix: Insert, correct, or remove the label.
Example
This program fails with E0252.
enum Shape {
Circle { radius: Int },
Empty,
}
fn size(s: Shape) -> Int {
match s {
Shape.Circle(r) => r
Shape.Empty => 0
}
}
Fixed
The same program, fixed.
enum Shape {
Circle { radius: Int },
Empty,
}
fn size(s: Shape) -> Int {
match s {
Shape.Circle(radius: r) => r
Shape.Empty => 0
}
}
Listed in the checker notes. oskac explain E0252 prints this entry offline.