improve diagnostics: break/continue wrong context
This commit is contained in:
parent
bea0372a1a
commit
a8d7ea74a4
12 changed files with 73 additions and 59 deletions
|
@ -1,14 +1,22 @@
|
|||
error[E0267]: `break` inside of an async block
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:33:9
|
||||
|
|
||||
LL | break 0u8;
|
||||
| ^^^^^^^^^ cannot break inside of an async block
|
||||
LL | async {
|
||||
| ___________-
|
||||
LL | | break 0u8;
|
||||
| | ^^^^^^^^^ cannot `break` inside of an `async` block
|
||||
LL | | };
|
||||
| |_____- enclosing `async` block
|
||||
|
||||
error[E0267]: `break` inside of an async block
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:40:13
|
||||
|
|
||||
LL | break 0u8;
|
||||
| ^^^^^^^^^ cannot break inside of an async block
|
||||
LL | async {
|
||||
| _______________-
|
||||
LL | | break 0u8;
|
||||
| | ^^^^^^^^^ cannot `break` inside of an `async` block
|
||||
LL | | };
|
||||
| |_________- enclosing `async` block
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:13:43
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue