Skip to content

Improve error message when failing to parse a block#35953

Merged
bors merged 1 commit into
rust-lang:masterfrom
Aatch:better-missing-block-error
Aug 27, 2016
Merged

Improve error message when failing to parse a block#35953
bors merged 1 commit into
rust-lang:masterfrom
Aatch:better-missing-block-error

Conversation

@Aatch

@Aatch Aatch commented Aug 23, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

r? @pnkfelix

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

@nrc

nrc commented Aug 26, 2016

Copy link
Copy Markdown
Member

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

@bors: r+

@bors

bors commented Aug 26, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 72d629c has been approved by nrc

@bors

bors commented Aug 26, 2016

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Aug 26, 2016

Copy link
Copy Markdown
Collaborator

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

@sophiajt

Copy link
Copy Markdown
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