2018-02-08 03:35:35 +00:00
|
|
|
error[E0027]: pattern does not mention field `name`
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
--> $DIR/E0027.rs:11:9
|
2018-02-08 03:35:35 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | Dog { age: x } => {}
|
2018-02-08 03:35:35 +00:00
|
|
|
| ^^^^^^^^^^^^^^ missing field `name`
|
2020-09-11 20:47:33 +00:00
|
|
|
|
|
|
|
|
help: include the missing field in the pattern
|
|
|
|
|
|
|
|
|
LL | Dog { age: x, name } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~~~
|
2020-11-06 03:55:58 +00:00
|
|
|
help: if you don't care about this missing field, you can explicitly ignore it
|
2020-09-11 20:47:33 +00:00
|
|
|
|
|
|
|
|
LL | Dog { age: x, .. } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~
|
2020-09-11 20:47:33 +00:00
|
|
|
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
error[E0027]: pattern does not mention field `age`
|
|
|
|
--> $DIR/E0027.rs:15:9
|
|
|
|
|
|
|
|
|
LL | Dog { name: x, } => {}
|
|
|
|
| ^^^^^^^^^^^^^^^^ missing field `age`
|
|
|
|
|
|
|
|
|
help: include the missing field in the pattern
|
|
|
|
|
|
|
|
|
LL | Dog { name: x, age } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~~
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
help: if you don't care about this missing field, you can explicitly ignore it
|
|
|
|
|
|
|
|
|
LL | Dog { name: x, .. } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
|
|
|
|
error[E0027]: pattern does not mention field `age`
|
|
|
|
--> $DIR/E0027.rs:19:9
|
|
|
|
|
|
|
|
|
LL | Dog { name: x , } => {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ missing field `age`
|
|
|
|
|
|
|
|
|
help: include the missing field in the pattern
|
|
|
|
|
|
|
|
|
LL | Dog { name: x, age } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~~
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
help: if you don't care about this missing field, you can explicitly ignore it
|
|
|
|
|
|
|
|
|
LL | Dog { name: x, .. } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
|
2020-09-11 20:47:33 +00:00
|
|
|
error[E0027]: pattern does not mention fields `name`, `age`
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
--> $DIR/E0027.rs:22:9
|
2020-09-11 20:47:33 +00:00
|
|
|
|
|
|
|
|
LL | Dog {} => {}
|
|
|
|
| ^^^^^^ missing fields `name`, `age`
|
|
|
|
|
|
|
|
|
help: include the missing fields in the pattern
|
|
|
|
|
|
|
|
|
LL | Dog { name, age } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~~~~~~~~
|
2020-11-06 03:55:58 +00:00
|
|
|
help: if you don't care about these missing fields, you can explicitly ignore them
|
2020-09-11 20:47:33 +00:00
|
|
|
|
|
|
|
|
LL | Dog { .. } => {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~
|
2018-02-08 03:35:35 +00:00
|
|
|
|
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
2021-01-16 23:41:52 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2018-02-08 03:35:35 +00:00
|
|
|
|
2018-03-03 14:59:40 +00:00
|
|
|
For more information about this error, try `rustc --explain E0027`.
|