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

Improve error message when failing to parse a block #35953

Merged
merged 1 commit into from
Aug 27, 2016

Conversation

Aatch
Copy link
Contributor

@Aatch Aatch commented Aug 23, 2016

We want to catch this error:

if (foo)
    bar;

as it's valid syntax in other languages, and say how to fix it.
Unfortunately it didn't care if the suggestion made sense and just
highlighted the unexpected token.

Now it attempts to parse a statement, and if it succeeds, it shows the
help message.

Fixes #35907

We want to catch this error:

```
if (foo)
    bar;
```

as it's valid syntax in other languages, and say how to fix it.
Unfortunately it didn't care if the suggestion made sense and just
highlighted the unexpected token.

Now it attempts to parse a statement, and if it succeeds, it shows the
help message.

Fixes rust-lang#35907
@rust-highfive
Copy link
Collaborator

r? @pnkfelix

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

@nrc
Copy link
Member

nrc commented Aug 26, 2016

Could you file an issue to add a template --explain error thing here please?

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 26, 2016

📌 Commit 72d629c has been approved by nrc

@bors
Copy link
Contributor

bors commented Aug 26, 2016

⌛ Testing commit 72d629c with merge 613fd2b...

@bors
Copy link
Contributor

bors commented Aug 26, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@sophiajt
Copy link
Contributor

@bors retry

Manishearth added a commit to Manishearth/rust that referenced this pull request Aug 27, 2016
…=nrc

Improve error message when failing to parse a block

We want to catch this error:

```
if (foo)
    bar;
```

as it's valid syntax in other languages, and say how to fix it.
Unfortunately it didn't care if the suggestion made sense and just
highlighted the unexpected token.

Now it attempts to parse a statement, and if it succeeds, it shows the
help message.

Fixes rust-lang#35907
bors added a commit that referenced this pull request Aug 27, 2016
Rollup of 7 pull requests

- Successful merges: #35124, #35877, #35953, #36002, #36004, #36005, #36014
- Failed merges:
@bors bors merged commit 72d629c into rust-lang:master Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nonsense help message for stray =>
6 participants