forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#106919 - compiler-errors:underscore-typo-in…
…-field-pat, r=jackh726 Recover `_` as `..` in field pattern
- Loading branch information
Showing
8 changed files
with
42 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 6 additions & 17 deletions
23
tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,13 @@ | ||
error: expected identifier, found reserved identifier `_` | ||
error: expected field pattern, found `_` | ||
--> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:27 | ||
| | ||
LL | if let Some(Foo::Bar {_}) = foo {} | ||
| ^ expected identifier, found reserved identifier | ||
|
||
error[E0027]: pattern does not mention field `bar` | ||
--> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:17 | ||
| | ||
LL | if let Some(Foo::Bar {_}) = foo {} | ||
| ^^^^^^^^^^^^ missing field `bar` | ||
| | ||
help: include the missing field in the pattern | ||
| ^ | ||
| | ||
LL | if let Some(Foo::Bar {_, bar }) = foo {} | ||
| ~~~~~~~ | ||
help: if you don't care about this missing field, you can explicitly ignore it | ||
help: to omit remaining fields, use `..` | ||
| | ||
LL | if let Some(Foo::Bar {_, .. }) = foo {} | ||
| ~~~~~~ | ||
LL | if let Some(Foo::Bar {..}) = foo {} | ||
| ~~ | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0027`. |