1
- error[E0425]: cannot find value `LOOP` in this scope
2
- --> $DIR/label_misspelled.rs:3:9
3
- |
4
- LL | 'LOOP: loop {
5
- | ----- a label with a similar name exists
6
- LL | LOOP;
7
- | ^^^^ not found in this scope
8
-
9
1
error[E0425]: cannot find value `while_loop` in this scope
10
- --> $DIR/label_misspelled.rs:7 :9
2
+ --> $DIR/label_misspelled.rs:3 :9
11
3
|
12
4
LL | 'while_loop: while true {
13
5
| ----------- a label with a similar name exists
14
6
LL | while_loop;
15
7
| ^^^^^^^^^^ not found in this scope
16
8
17
9
error[E0425]: cannot find value `while_let` in this scope
18
- --> $DIR/label_misspelled.rs:11 :9
10
+ --> $DIR/label_misspelled.rs:7 :9
19
11
|
20
12
LL | 'while_let: while let Some(_) = Some(()) {
21
13
| ---------- a label with a similar name exists
22
14
LL | while_let;
23
15
| ^^^^^^^^^ not found in this scope
24
16
25
17
error[E0425]: cannot find value `for_loop` in this scope
26
- --> $DIR/label_misspelled.rs:15 :9
18
+ --> $DIR/label_misspelled.rs:11 :9
27
19
|
28
20
LL | 'for_loop: for _ in 0..3 {
29
21
| --------- a label with a similar name exists
30
22
LL | for_loop;
31
23
| ^^^^^^^^ not found in this scope
32
24
25
+ error[E0425]: cannot find value `LOOP` in this scope
26
+ --> $DIR/label_misspelled.rs:15:9
27
+ |
28
+ LL | 'LOOP: loop {
29
+ | ----- a label with a similar name exists
30
+ LL | LOOP;
31
+ | ^^^^ not found in this scope
32
+
33
33
error[E0425]: cannot find value `LOOP` in this scope
34
34
--> $DIR/label_misspelled.rs:22:15
35
35
|
@@ -53,7 +53,7 @@ LL | break while_loop;
53
53
| help: use the similarly named label: `'while_loop`
54
54
55
55
error[E0425]: cannot find value `while_let` in this scope
56
- --> $DIR/label_misspelled.rs:31 :15
56
+ --> $DIR/label_misspelled.rs:30 :15
57
57
|
58
58
LL | 'while_let: while let Some(_) = Some(()) {
59
59
| ---------- a label with a similar name exists
@@ -64,7 +64,7 @@ LL | break while_let;
64
64
| help: use the similarly named label: `'while_let`
65
65
66
66
error[E0425]: cannot find value `for_loop` in this scope
67
- --> $DIR/label_misspelled.rs:36 :15
67
+ --> $DIR/label_misspelled.rs:34 :15
68
68
|
69
69
LL | 'for_loop: for _ in 0..3 {
70
70
| --------- a label with a similar name exists
@@ -75,7 +75,7 @@ LL | break for_loop;
75
75
| help: use the similarly named label: `'for_loop`
76
76
77
77
warning: denote infinite loops with `loop { ... }`
78
- --> $DIR/label_misspelled.rs:6 :5
78
+ --> $DIR/label_misspelled.rs:2 :5
79
79
|
80
80
LL | 'while_loop: while true {
81
81
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
@@ -88,40 +88,64 @@ warning: denote infinite loops with `loop { ... }`
88
88
LL | 'while_loop: while true {
89
89
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
90
90
91
+ warning: denote infinite loops with `loop { ... }`
92
+ --> $DIR/label_misspelled.rs:41:5
93
+ |
94
+ LL | 'while_loop: while true {
95
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
96
+
91
97
error[E0571]: `break` with value from a `while` loop
92
- --> $DIR/label_misspelled.rs:26 :9
98
+ --> $DIR/label_misspelled.rs:42 :9
93
99
|
94
- LL | break while_loop;
95
- | ^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
100
+ LL | 'while_loop: while true {
101
+ | ----------------------- you can't `break` with a value in a `while` loop
102
+ LL | break foo;
103
+ | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
96
104
|
97
- help: instead, use `break` on its own without a value inside this `while` loop
105
+ help: use `break` on its own without a value inside this `while` loop
98
106
|
99
107
LL | break;
100
108
| ^^^^^
109
+ help: alternatively, you might have meant to use the available loop label
110
+ |
111
+ LL | break 'while_loop;
112
+ | ^^^^^^^^^^^
101
113
102
114
error[E0571]: `break` with value from a `while` loop
103
- --> $DIR/label_misspelled.rs:31 :9
115
+ --> $DIR/label_misspelled.rs:46 :9
104
116
|
105
- LL | break while_let;
106
- | ^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
117
+ LL | 'while_let: while let Some(_) = Some(()) {
118
+ | ---------------------------------------- you can't `break` with a value in a `while` loop
119
+ LL | break foo;
120
+ | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
107
121
|
108
- help: instead, use `break` on its own without a value inside this `while` loop
122
+ help: use `break` on its own without a value inside this `while` loop
109
123
|
110
124
LL | break;
111
125
| ^^^^^
126
+ help: alternatively, you might have meant to use the available loop label
127
+ |
128
+ LL | break 'while_let;
129
+ | ^^^^^^^^^^
112
130
113
131
error[E0571]: `break` with value from a `for` loop
114
- --> $DIR/label_misspelled.rs:36 :9
132
+ --> $DIR/label_misspelled.rs:50 :9
115
133
|
116
- LL | break for_loop;
117
- | ^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
134
+ LL | 'for_loop: for _ in 0..3 {
135
+ | ------------------------ you can't `break` with a value in a `for` loop
136
+ LL | break foo;
137
+ | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
118
138
|
119
- help: instead, use `break` on its own without a value inside this `for` loop
139
+ help: use `break` on its own without a value inside this `for` loop
120
140
|
121
141
LL | break;
122
142
| ^^^^^
143
+ help: alternatively, you might have meant to use the available loop label
144
+ |
145
+ LL | break 'for_loop;
146
+ | ^^^^^^^^^
123
147
124
- error: aborting due to 11 previous errors; 2 warnings emitted
148
+ error: aborting due to 11 previous errors; 3 warnings emitted
125
149
126
150
Some errors have detailed explanations: E0425, E0571.
127
151
For more information about an error, try `rustc --explain E0425`.
0 commit comments