File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ let _ = [ 'a' ; { break 2 ; 1 } ] ;
3+ //~^ ERROR `break` outside of a loop or labeled block
4+ //~| HELP consider labeling this block to be able to break within it
5+
6+ const {
7+ {
8+ //~^ HELP consider labeling this block to be able to break within it
9+ break ;
10+ //~^ ERROR `break` outside of a loop or labeled block
11+ }
12+ } ;
13+
14+ const {
15+ break ;
16+ //~^ ERROR `break` outside of a loop or labeled block
17+ } ;
18+ }
Original file line number Diff line number Diff line change 1+ error[E0268]: `break` outside of a loop or labeled block
2+ --> $DIR/break-inside-inline-const-issue-128604.rs:15:9
3+ |
4+ LL | break;
5+ | ^^^^^ cannot `break` outside of a loop or labeled block
6+
7+ error[E0268]: `break` outside of a loop or labeled block
8+ --> $DIR/break-inside-inline-const-issue-128604.rs:2:21
9+ |
10+ LL | let _ = ['a'; { break 2; 1 }];
11+ | ^^^^^^^ cannot `break` outside of a loop or labeled block
12+ |
13+ help: consider labeling this block to be able to break within it
14+ |
15+ LL | let _ = ['a'; 'block: { break 'block 2; 1 }];
16+ | +++++++ ++++++
17+
18+ error[E0268]: `break` outside of a loop or labeled block
19+ --> $DIR/break-inside-inline-const-issue-128604.rs:9:13
20+ |
21+ LL | break;
22+ | ^^^^^ cannot `break` outside of a loop or labeled block
23+ |
24+ help: consider labeling this block to be able to break within it
25+ |
26+ LL ~ 'block: {
27+ LL |
28+ LL ~ break 'block;
29+ |
30+
31+ error: aborting due to 3 previous errors
32+
33+ For more information about this error, try `rustc --explain E0268`.
You can’t perform that action at this time.
0 commit comments