Skip to content

Commit da10963

Browse files
committed
typeck/pat: address review comments
1 parent bd34826 commit da10963

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc_typeck/check/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11171117
);
11181118
err.span_suggestion_verbose(
11191119
sp_comma,
1120-
"add `..` at the end of the field list",
1120+
"add `..` at the end of the field list to ignore all other fields",
11211121
sugg.to_string(),
11221122
Applicability::MachineApplicable,
11231123
);

src/test/ui/rfc-2008-non-exhaustive/struct.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ error[E0638]: `..` required with struct marked as non-exhaustive
6363
LL | let NormalStruct { first_field, second_field } = ns;
6464
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6565
|
66-
help: add `..` at the end of the field list
66+
help: add `..` at the end of the field list to ignore all other fields
6767
|
6868
LL | let NormalStruct { first_field, second_field , .. } = ns;
6969
| ^^^^^^
@@ -74,7 +74,7 @@ error[E0638]: `..` required with struct marked as non-exhaustive
7474
LL | let TupleStruct { 0: first_field, 1: second_field } = ts;
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7676
|
77-
help: add `..` at the end of the field list
77+
help: add `..` at the end of the field list to ignore all other fields
7878
|
7979
LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts;
8080
| ^^^^^^
@@ -85,7 +85,7 @@ error[E0638]: `..` required with struct marked as non-exhaustive
8585
LL | let UnitStruct { } = us;
8686
| ^^^^^^^^^^^^^^
8787
|
88-
help: add `..` at the end of the field list
88+
help: add `..` at the end of the field list to ignore all other fields
8989
|
9090
LL | let UnitStruct { .. } = us;
9191
| ^^^^

src/test/ui/rfc-2008-non-exhaustive/variant.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ error[E0638]: `..` required with variant marked as non-exhaustive
7070
LL | NonExhaustiveVariants::Struct { field } => ""
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272
|
73-
help: add `..` at the end of the field list
73+
help: add `..` at the end of the field list to ignore all other fields
7474
|
7575
LL | NonExhaustiveVariants::Struct { field , .. } => ""
7676
| ^^^^^^
@@ -81,7 +81,7 @@ error[E0638]: `..` required with variant marked as non-exhaustive
8181
LL | if let NonExhaustiveVariants::Struct { field } = variant_struct {
8282
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8383
|
84-
help: add `..` at the end of the field list
84+
help: add `..` at the end of the field list to ignore all other fields
8585
|
8686
LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct {
8787
| ^^^^^^

0 commit comments

Comments
 (0)