Skip to content

Improve diagnostics when list of tokens has incorrect separators #45503

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

Merged
merged 2 commits into from
Oct 28, 2017

Conversation

thombles
Copy link
Contributor

Make parse_seq_to_before_tokens more resilient to error conditions. Where possible it is better if it can consume up to the final bracket before returning. This change improves the diagnostics in a couple of situations:

struct S(pub () ()); // omitted separator
use std::{foo. bar}; // used a similar but wrong separator

Fixes #44339
r? @petrochenkov

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (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.

@thombles thombles changed the title Tk/i44339 v5 Improve diagnostics when list of tokens has incorrect separators Oct 24, 2017
@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2017
@petrochenkov
Copy link
Contributor

Now this looks great, thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Oct 28, 2017

📌 Commit ae6a9e6 has been approved by petrochenkov

@bors
Copy link
Collaborator

bors commented Oct 28, 2017

⌛ Testing commit ae6a9e6 with merge c1a0b6d...

bors added a commit that referenced this pull request Oct 28, 2017
Improve diagnostics when list of tokens has incorrect separators

Make `parse_seq_to_before_tokens` more resilient to error conditions. Where possible it is better if it can consume up to the final bracket before returning. This change improves the diagnostics in a couple of situations:

```
struct S(pub () ()); // omitted separator
use std::{foo. bar}; // used a similar but wrong separator
```

Fixes #44339
r? @petrochenkov
@bors
Copy link
Collaborator

bors commented Oct 28, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing c1a0b6d to master...

@bors bors merged commit ae6a9e6 into rust-lang:master Oct 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants