From 9d4620870c42224cc91d532b4e4cb20bbc2270b5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 15 Nov 2019 13:04:52 +0100 Subject: [PATCH] Clean up E0023 --- src/librustc_error_codes/error_codes/E0023.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0023.md b/src/librustc_error_codes/error_codes/E0023.md index 92cae460c81d..23a9d22a60d8 100644 --- a/src/librustc_error_codes/error_codes/E0023.md +++ b/src/librustc_error_codes/error_codes/E0023.md @@ -1,6 +1,6 @@ -A pattern used to match against an enum variant must provide a sub-pattern for -each field of the enum variant. This error indicates that a pattern attempted to -extract an incorrect number of fields from a variant. +A pattern attempted to extract an incorrect number of fields from a variant. + +Erroneous code example: ``` enum Fruit { @@ -9,6 +9,9 @@ enum Fruit { } ``` +A pattern used to match against an enum variant must provide a sub-pattern for +each field of the enum variant. + Here the `Apple` variant has two fields, and should be matched against like so: ```