improve diagnostics: break/continue wrong context
This commit is contained in:
parent
bea0372a1a
commit
a8d7ea74a4
12 changed files with 73 additions and 59 deletions
|
|
@ -2,7 +2,9 @@ error[E0267]: `break` inside of a closure
|
|||
--> $DIR/E0267.rs:2:18
|
||||
|
|
||||
LL | let w = || { break; };
|
||||
| ^^^^^ cannot break inside of a closure
|
||||
| -- ^^^^^ cannot `break` inside of a closure
|
||||
| |
|
||||
| enclosing closure
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0268]: `break` outside of loop
|
||||
error[E0268]: `break` outside of a loop
|
||||
--> $DIR/E0268.rs:2:5
|
||||
|
|
||||
LL | break;
|
||||
| ^^^^^ cannot break outside of a loop
|
||||
| ^^^^^ cannot `break` outside of a loop
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue