Closed
Description
One of the ways to reproduce:
enum X {
Y(u32)
}
fn main() {
match X::Y(0) {
X::Y { data } => ()
}
}
This results in:
error[E0026]: variant `X::Y` does not have a field named `data`
--> <anon>:7:16
|
7 | X::Y { data } => ()
| ^^^^ variant `X::Y` does not have field `data`
error[E0027]: pattern does not mention field `0`
--> <anon>:7:9
|
7 | X::Y { data } => ()
| ^^^^^^^^^^^^^ missing field `0`
I think the error message would have been much better if it just said outright that variant X::Y requires a tuple pattern
or something like that (I'm not sure what the proper terminology is...)
This happens fairly often during refactoring.