Skip to content

Commit

Permalink
typeck/pat: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Mar 26, 2020
1 parent bd34826 commit da10963
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/pat.rs
Expand Up @@ -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,
);
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/rfc-2008-non-exhaustive/struct.stderr
Expand Up @@ -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;
| ^^^^^^
Expand All @@ -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;
| ^^^^^^
Expand All @@ -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;
| ^^^^
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2008-non-exhaustive/variant.stderr
Expand Up @@ -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 , .. } => ""
| ^^^^^^
Expand All @@ -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 {
| ^^^^^^
Expand Down

0 comments on commit da10963

Please sign in to comment.