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

Make parser aware of await where macro calls are expected #60829

Closed
wants to merge 1 commit into from

Conversation

Pulkit07
Copy link
Contributor

This makes the parser to first check for '!' and see if it exists or not before
parsing it as await!. This is done because a proposed new syntax for await is
expression.await and hence await keyword can be used without !.

It fixes #60653

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(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 May 14, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

This makes the parser to first check for '!' and see if it exists or not before
parsing it as `await!`. This is done because a proposed new syntax for await is
`expression.await` and hence await keyword can be used without `!`.

It fixes rust-lang#60653
@Centril
Copy link
Contributor

Centril commented May 14, 2019

r? @estebank

@bors rollup

@bors
Copy link
Contributor

bors commented May 17, 2019

☔ The latest upstream changes (presumably #60898) made this pull request unmergeable. Please resolve the merge conflicts.

@estebank
Copy link
Contributor

@Pulkit07 thank you for your change. It was reasonably done and would have worked. Sadly, #60873 supersedes this change, which I started working on before I saw one was in the review queue. That change slightly regressing the output in a different, but I think more understandable, way:

error: incorrect use of `await`
  --> src/main.rs:12:11
   |
12 |     match await { await => () } //~ ERROR expected `!`, found `{`
   |           ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`

error: expected one of `.`, `?`, `{`, or an operator, found `}`
  --> src/main.rs:13:1
   |
12 |     match await { await => () } //~ ERROR expected `!`, found `{`
   |     -----                      - expected one of `.`, `?`, `{`, or an operator here
   |     |
   |     while parsing this match expression
13 | }
   | ^ unexpected token

Please do not let this stop you from contributing in the future.

@estebank estebank closed this May 29, 2019
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.

Make the parser aware of await where macro calls are expected
6 participants