improve diagnostics: break/continue wrong context

This commit is contained in:
Artem Varaksa 2019-08-21 13:17:59 +03:00
parent bea0372a1a
commit a8d7ea74a4
12 changed files with 73 additions and 59 deletions

View file

@ -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

View file

@ -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