Skip to content

Mention expectation of { for parse error immediately after async in expressions #80931

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
estebank opened this issue Jan 12, 2021 · 0 comments · Fixed by #142362
Closed

Mention expectation of { for parse error immediately after async in expressions #80931

estebank opened this issue Jan 12, 2021 · 0 comments · Fixed by #142362
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The lexing & parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

The following code

error: expected one of `move`, `|`, or `||`, found keyword `let`
--> $DIR/block-no-opening-brace.rs:30:9
|
LL | async
| - expected one of `move`, `|`, or `||`
LL | let x = 0;
| ^^^ unexpected token

should also mention an expectation for an open brace {, and potentially even suggesting a new block, like the other test cases in that file.

@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The lexing & parsing of Rust source code to an AST P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-papercut Diagnostics: An error or lint that needs small tweaks. labels Jan 12, 2021
@JohnTitor JohnTitor added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jan 12, 2021
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Sep 23, 2024
…e, r=jieyouxu

Add more test cases for block-no-opening-brace

Also add FIXME's for rust-lang#80931 & rust-lang#78168
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Sep 23, 2024
…e, r=jieyouxu

Add more test cases for block-no-opening-brace

Also add FIXME's for rust-lang#80931 & rust-lang#78168
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 23, 2024
Rollup merge of rust-lang#130721 - GrigorenkoPV:block-no-opening-brace, r=jieyouxu

Add more test cases for block-no-opening-brace

Also add FIXME's for rust-lang#80931 & rust-lang#78168
@bors bors closed this as completed in e78b619 Jun 12, 2025
rust-timer added a commit that referenced this issue Jun 12, 2025
Rollup merge of #142362 - Veykril:push-rzmrsswqourz, r=oli-obk

Add expectation for `{` when parsing lone coroutine qualifiers

Fixes #80931
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The lexing & parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants