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 diagnostic for `break` in `async { ... }` block #63391

Centril opened this issue Aug 8, 2019 · 3 comments


Copy link

commented Aug 8, 2019



fn foo() {
    async {

you get:

error[E0267]: `break` inside of a closure
 --> src/
5 |         break;
  |         ^^^^^ cannot break inside of a closure

Note how it references "a closure" which seems confusing for a user who doesn't presume the implementation.


This comment has been minimized.

Copy link

commented Aug 17, 2019

@rustbot claim


This comment has been minimized.

Copy link

commented Aug 18, 2019

I'm assuming its ok to leave this as the same error code of E0267 - in essence it's the same error, just more specific text.


This comment has been minimized.

Copy link
Member Author

commented Aug 18, 2019

Yeah I think it's fine.

Centril added a commit to Centril/rust that referenced this issue Aug 18, 2019

Rollup merge of rust-lang#63659 - gilescope:async-in-closure, r=Centril
Improved error message for break in async block

Fixes rust-lang#63391

@bors bors closed this in 4cf7673 Aug 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.