Skip to content
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

Do not complain about unmentioned fields in recovered patterns #59198

Merged
merged 1 commit into from
Mar 28, 2019

Conversation

estebank
Copy link
Contributor

When the parser has to recover from malformed code in a pattern, do not
complain about missing fields.

Fix #59145.

When the parser has to recover from malformed code in a pattern, do not
complain about missing fields.
@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 15, 2019
@estebank
Copy link
Contributor Author

r? @zackmdavis

@rust-highfive rust-highfive assigned zackmdavis and unassigned eddyb Mar 15, 2019
@estebank
Copy link
Contributor Author

r? @davidtwco

@@ -4698,7 +4698,7 @@ impl<'a> Parser<'a> {
let (fields, etc) = self.parse_pat_fields().unwrap_or_else(|mut e| {
e.emit();
self.recover_stmt();
(vec![], false)
(vec![], true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing my understanding: this is getting assigned to the name etc; so, the mechanism here is that we're pretending that struct patterns that failed to parse have a .. so that we shouldn't emit additional errors about missing fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@zackmdavis
Copy link
Member

Looks like I need to keep better track of my review queue. 😰

r? @zackmdavis

@bors r+

@bors
Copy link
Contributor

bors commented Mar 26, 2019

📌 Commit 6cd6759 has been approved by zackmdavis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 26, 2019
Centril added a commit to Centril/rust that referenced this pull request Mar 28, 2019
…davis

Do not complain about unmentioned fields in recovered patterns

When the parser has to recover from malformed code in a pattern, do not
complain about missing fields.

Fix rust-lang#59145.
bors added a commit that referenced this pull request Mar 28, 2019
Rollup of 12 pull requests

Successful merges:

 - #57987 (Fix some AArch64 typos)
 - #58581 (Refactor generic parameter encoder functions)
 - #58803 (fs::copy() unix: set file mode early)
 - #58848 (Prevent cache issues on version updates)
 - #59198 (Do not complain about unmentioned fields in recovered patterns)
 - #59351 (Include llvm-ar with llvm-tools component)
 - #59413 (HirIdify hir::ItemId)
 - #59441 (Remove the block on natvis for lld-link.)
 - #59448 (Use consistent phrasing for all macro summaries)
 - #59456 (Add documentation about `for` used as higher ranked trait bounds)
 - #59472 (Document that `std::io::BufReader` discards contents on drop)
 - #59474 (Fix link capitalization in documentation of std::io::BufWriter.)

Failed merges:

r? @ghost
@bors bors merged commit 6cd6759 into rust-lang:master Mar 28, 2019
@estebank estebank deleted the recovered-pattern branch November 9, 2023 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants