diff options
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0023.md | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustc_error_codes/error_codes/E0023.md b/src/librustc_error_codes/error_codes/E0023.md index 23a9d22a60d..c1d85705da3 100644 --- a/src/librustc_error_codes/error_codes/E0023.md +++ b/src/librustc_error_codes/error_codes/E0023.md @@ -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 |
