about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-01-14 17:59:55 +0000
committerGitHub <noreply@github.com>2021-01-14 17:59:55 +0000
commitd3b31065e36df802e63be282f0b5148cc8b1a68a (patch)
tree0a513c9b5437dad040e60d2c4c1a667ef3c8c7a6 /src/test/ui/error-codes
parent8ac21fb201bc374fe958a0a98150c2c8d2c798db (diff)
parente8c87935e0004ff784ad361a5bac39d7677c3f4f (diff)
downloadrust-d3b31065e36df802e63be282f0b5148cc8b1a68a.tar.gz
rust-d3b31065e36df802e63be282f0b5148cc8b1a68a.zip
Rollup merge of #80017 - camelid:sugg-rest-pattern, r=estebank
Suggest `_` and `..` if a pattern has too few fields

Fixes #80010.
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0023.stderr9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/ui/error-codes/E0023.stderr b/src/test/ui/error-codes/E0023.stderr
index a3610099294..832eba69722 100644
--- a/src/test/ui/error-codes/E0023.stderr
+++ b/src/test/ui/error-codes/E0023.stderr
@@ -6,6 +6,11 @@ LL |     Apple(String, String),
 ...
 LL |         Fruit::Apple(a) => {},
    |         ^^^^^^^^^^^^^^^ expected 2 fields, found 1
+   |
+help: use `_` to explicitly ignore each field
+   |
+LL |         Fruit::Apple(a, _) => {},
+   |                       ^^^
 
 error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
   --> $DIR/E0023.rs:12:9
@@ -34,7 +39,7 @@ LL |     Orange((String, String)),
 LL |         Fruit::Orange(a, b) => {},
    |         ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
    |
-help: missing parenthesis
+help: missing parentheses
    |
 LL |         Fruit::Orange((a, b)) => {},
    |                       ^    ^
@@ -48,7 +53,7 @@ LL |     Banana(()),
 LL |         Fruit::Banana() => {},
    |         ^^^^^^^^^^^^^^^ expected 1 field, found 0
    |
-help: missing parenthesis
+help: missing parentheses
    |
 LL |         Fruit::Banana(()) => {},
    |                      ^  ^