-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
parser: recover on ...
as a pattern, suggesting ..
#70417
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @varkor (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
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.
Looks promising. I've left some bits to tweak for now.
Please also add a test in src/test/ui/parser/issue-70388-recover-dotdotdot-rest-pat.rs
which would include the typo in e.g. TupleStruct(...)
and a slice pattern [x, ..., y]
. Also make sure to add something like let _recovery_witness: () = 0; //~ ERROR mismatched types
, which we use to check that we can reach the type checking phase of the compiler (so we show there is parser recovery).
r? @Centril |
… a pattern Added tests and stderr output
@Centril added your suggestions. Squashed them all to a single commit as well. Pliss review. |
...
instead of a ..
...
as a pattern, suggesting ..
Thanks. This looks fabulous! 💖 @bors r+ |
📌 Commit 73c8203 has been approved by |
Yay! Thanks a ton! |
parser: recover on `...` as a pattern, suggesting `..` Fixes rust-lang#70388 My first PR to rust. So please let me know if I'm doing something wrong.
Rollup of 5 pull requests Successful merges: - rust-lang#68004 (permit negative impls for non-auto traits) - rust-lang#70385 (Miri nits: comment and var name improvement) - rust-lang#70411 (Fix for rust-lang#62691: use the largest niche across all fields) - rust-lang#70417 (parser: recover on `...` as a pattern, suggesting `..`) - rust-lang#70424 (simplify match stmt) Failed merges: r? @ghost
Fixes #70388
My first PR to rust. So please let me know if I'm doing something wrong.