-
Notifications
You must be signed in to change notification settings - Fork 13k
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
typeck: minor pattern typing improvements #70386
Conversation
LL | let NormalStruct { first_field, second_field , .. } = ns; | ||
| ^^^^^^ |
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.
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 comment
The 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. :)
@@ -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 |
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
@bors r=estebank |
📌 Commit da10963 has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#69866 (Rename `def_span` to `guess_head_span`) - rust-lang#69878 (Tweak chained operators diagnostic) - rust-lang#70375 (avoid catching InterpError) - rust-lang#70386 (typeck: minor pattern typing improvements) - rust-lang#70389 (borrowck: prefer "value" over "`_`" in diagnostics) - rust-lang#70395 (Update cargo.) Failed merges: r? @ghost
r? @estebank