Improve E0023 long error explanation

This commit is contained in:
Guillaume Gomez 2019-11-22 13:25:48 +01:00
parent ea62c2e5b3
commit 60d9c2c239

View file

@ -2,11 +2,18 @@ A pattern attempted to extract an incorrect number of fields from a variant.
Erroneous code example:
```
```compile_fail,E0023
enum Fruit {
Apple(String, String),
Pear(u32),
}
let x = Fruit::Apple(String::new(), String::new());
match x {
Fruit::Apple(a) => {}, // error!
_ => {}
}
```
A pattern used to match against an enum variant must provide a sub-pattern for