-
Notifications
You must be signed in to change notification settings - Fork 13.9k
typeck: minor pattern typing improvements #70386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,18 +62,33 @@ 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 | ||
| | | ||
| LL | let NormalStruct { first_field, second_field , .. } = ns; | ||
| | ^^^^^^ | ||
|
Comment on lines
+68
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like it if we could get around pointing at the closing brace and the preceding space, but that would complicate the span gather code quite dramatically... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trust me, I tried several clever iterations to fix that but I got nowhere. :) |
||
|
|
||
| error[E0638]: `..` required with struct marked as non-exhaustive | ||
| --> $DIR/struct.rs:26:9 | ||
| | | ||
| LL | let TupleStruct { 0: first_field, 1: second_field } = ts; | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| help: add `..` at the end of the field list | ||
| | | ||
| LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts; | ||
| | ^^^^^^ | ||
|
|
||
| error[E0638]: `..` required with struct marked as non-exhaustive | ||
| --> $DIR/struct.rs:35:9 | ||
| | | ||
| LL | let UnitStruct { } = us; | ||
| | ^^^^^^^^^^^^^^ | ||
| | | ||
| help: add `..` at the end of the field list | ||
| | | ||
| LL | let UnitStruct { .. } = us; | ||
| | ^^^^ | ||
|
|
||
| error: aborting due to 9 previous errors | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some explanation along the lines of "add
..at the end of the field list to ignore all other fields".r=me