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

@ -1,14 +1,14 @@
error[E0268]: `continue` outside of loop
error[E0268]: `continue` outside of a loop
--> $DIR/issue-28105.rs:4:5
|
LL | continue
| ^^^^^^^^ cannot break outside of a loop
| ^^^^^^^^ cannot `continue` outside of a loop
error[E0268]: `break` outside of loop
error[E0268]: `break` outside of a loop
--> $DIR/issue-28105.rs:6:5
|
LL | break
| ^^^^^ cannot break outside of a loop
| ^^^^^ cannot `break` outside of a loop
error: aborting due to 2 previous errors

View file

@ -1,14 +1,14 @@
error[E0268]: `break` outside of loop
error[E0268]: `break` outside of a loop
--> $DIR/issue-43162.rs:3:5
|
LL | break true;
| ^^^^^^^^^^ cannot break outside of a loop
| ^^^^^^^^^^ cannot `break` outside of a loop
error[E0268]: `break` outside of loop
error[E0268]: `break` outside of a loop
--> $DIR/issue-43162.rs:7:5
|
LL | break {};
| ^^^^^^^^ cannot break outside of a loop
| ^^^^^^^^ cannot `break` outside of a loop
error[E0308]: mismatched types
--> $DIR/issue-43162.rs:1:13

View file

@ -4,17 +4,17 @@ error[E0426]: use of undeclared label `'L`
LL | |bool: [u8; break 'L]| 0;
| ^^ undeclared label `'L`
error[E0268]: `break` outside of loop
error[E0268]: `break` outside of a loop
--> $DIR/issue-50576.rs:2:17
|
LL | |bool: [u8; break 'L]| 0;
| ^^^^^^^^ cannot break outside of a loop
| ^^^^^^^^ cannot `break` outside of a loop
error[E0268]: `break` outside of loop
error[E0268]: `break` outside of a loop
--> $DIR/issue-50576.rs:5:16
|
LL | Vec::<[u8; break]>::new();
| ^^^^^ cannot break outside of a loop
| ^^^^^ cannot `break` outside of a loop
error: aborting due to 3 previous errors

View file

@ -1,8 +1,8 @@
error[E0268]: `break` outside of loop
error[E0268]: `break` outside of a loop
--> $DIR/issue-50581.rs:2:14
|
LL | |_: [u8; break]| ();
| ^^^^^ cannot break outside of a loop
| ^^^^^ cannot `break` outside of a loop
error: aborting due to previous error