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