diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-26 02:29:42 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-26 02:29:42 +0100 |
| commit | da10963357f91eb1aa8100f224d5ce19a0d4424b (patch) | |
| tree | 8b1bd7ece211404f4aa3915d2954ba2e2d1556d5 | |
| parent | bd3482632e71681aade51ac1e97730eb907c7249 (diff) | |
| download | rust-da10963357f91eb1aa8100f224d5ce19a0d4424b.tar.gz rust-da10963357f91eb1aa8100f224d5ce19a0d4424b.zip | |
typeck/pat: address review comments
| -rw-r--r-- | src/librustc_typeck/check/pat.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/rfc-2008-non-exhaustive/struct.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/rfc-2008-non-exhaustive/variant.stderr | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs index c235a0bb4ea..0c4a05e6181 100644 --- a/src/librustc_typeck/check/pat.rs +++ b/src/librustc_typeck/check/pat.rs @@ -1117,7 +1117,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ); err.span_suggestion_verbose( sp_comma, - "add `..` at the end of the field list", + "add `..` at the end of the field list to ignore all other fields", sugg.to_string(), Applicability::MachineApplicable, ); diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr index b1351e6fb9c..3bc38830537 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr @@ -63,7 +63,7 @@ error[E0638]: `..` required with struct marked as non-exhaustive LL | let NormalStruct { first_field, second_field } = ns; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: add `..` at the end of the field list +help: add `..` at the end of the field list to ignore all other fields | LL | let NormalStruct { first_field, second_field , .. } = ns; | ^^^^^^ @@ -74,7 +74,7 @@ error[E0638]: `..` required with struct marked as non-exhaustive LL | let TupleStruct { 0: first_field, 1: second_field } = ts; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: add `..` at the end of the field list +help: add `..` at the end of the field list to ignore all other fields | LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts; | ^^^^^^ @@ -85,7 +85,7 @@ error[E0638]: `..` required with struct marked as non-exhaustive LL | let UnitStruct { } = us; | ^^^^^^^^^^^^^^ | -help: add `..` at the end of the field list +help: add `..` at the end of the field list to ignore all other fields | LL | let UnitStruct { .. } = us; | ^^^^ diff --git a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr index 94432ce29d5..fbdbb0c9930 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr @@ -70,7 +70,7 @@ error[E0638]: `..` required with variant marked as non-exhaustive LL | NonExhaustiveVariants::Struct { field } => "" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: add `..` at the end of the field list +help: add `..` at the end of the field list to ignore all other fields | LL | NonExhaustiveVariants::Struct { field , .. } => "" | ^^^^^^ @@ -81,7 +81,7 @@ error[E0638]: `..` required with variant marked as non-exhaustive LL | if let NonExhaustiveVariants::Struct { field } = variant_struct { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: add `..` at the end of the field list +help: add `..` at the end of the field list to ignore all other fields | LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct { | ^^^^^^ |
