1
1
error[E0425]: cannot find value `while_loop` in this scope
2
- --> $DIR/label_misspelled.rs:3 :9
2
+ --> $DIR/label_misspelled.rs:6 :9
3
3
|
4
4
LL | 'while_loop: while true {
5
5
| ----------- a label with a similar name exists
6
+ LL |
6
7
LL | while_loop;
7
8
| ^^^^^^^^^^ not found in this scope
8
9
9
10
error[E0425]: cannot find value `while_let` in this scope
10
- --> $DIR/label_misspelled.rs:7 :9
11
+ --> $DIR/label_misspelled.rs:11 :9
11
12
|
12
13
LL | 'while_let: while let Some(_) = Some(()) {
13
14
| ---------- a label with a similar name exists
15
+ LL |
14
16
LL | while_let;
15
17
| ^^^^^^^^^ not found in this scope
16
18
17
19
error[E0425]: cannot find value `for_loop` in this scope
18
- --> $DIR/label_misspelled.rs:11 :9
20
+ --> $DIR/label_misspelled.rs:16 :9
19
21
|
20
22
LL | 'for_loop: for _ in 0..3 {
21
23
| --------- a label with a similar name exists
24
+ LL |
22
25
LL | for_loop;
23
26
| ^^^^^^^^ not found in this scope
24
27
25
28
error[E0425]: cannot find value `LOOP` in this scope
26
- --> $DIR/label_misspelled.rs:15 :9
29
+ --> $DIR/label_misspelled.rs:21 :9
27
30
|
28
31
LL | 'LOOP: loop {
29
32
| ----- a label with a similar name exists
33
+ LL |
30
34
LL | LOOP;
31
35
| ^^^^ not found in this scope
32
36
33
37
error[E0425]: cannot find value `LOOP` in this scope
34
- --> $DIR/label_misspelled.rs:22 :15
38
+ --> $DIR/label_misspelled.rs:29 :15
35
39
|
36
40
LL | 'LOOP: loop {
37
41
| ----- a label with a similar name exists
42
+ LL |
38
43
LL | break LOOP;
39
44
| ^^^^
40
45
| |
41
46
| not found in this scope
42
47
| help: use the similarly named label: `'LOOP`
43
48
44
49
error[E0425]: cannot find value `while_loop` in this scope
45
- --> $DIR/label_misspelled.rs:26 :15
50
+ --> $DIR/label_misspelled.rs:34 :15
46
51
|
47
52
LL | 'while_loop: while true {
48
53
| ----------- a label with a similar name exists
54
+ LL |
49
55
LL | break while_loop;
50
56
| ^^^^^^^^^^
51
57
| |
52
58
| not found in this scope
53
59
| help: use the similarly named label: `'while_loop`
54
60
55
61
error[E0425]: cannot find value `while_let` in this scope
56
- --> $DIR/label_misspelled.rs:30 :15
62
+ --> $DIR/label_misspelled.rs:39 :15
57
63
|
58
64
LL | 'while_let: while let Some(_) = Some(()) {
59
65
| ---------- a label with a similar name exists
66
+ LL |
60
67
LL | break while_let;
61
68
| ^^^^^^^^^
62
69
| |
63
70
| not found in this scope
64
71
| help: use the similarly named label: `'while_let`
65
72
66
73
error[E0425]: cannot find value `for_loop` in this scope
67
- --> $DIR/label_misspelled.rs:34 :15
74
+ --> $DIR/label_misspelled.rs:44 :15
68
75
|
69
76
LL | 'for_loop: for _ in 0..3 {
70
77
| --------- a label with a similar name exists
78
+ LL |
71
79
LL | break for_loop;
72
80
| ^^^^^^^^
73
81
| |
74
82
| not found in this scope
75
83
| help: use the similarly named label: `'for_loop`
76
84
85
+ warning: unused label
86
+ --> $DIR/label_misspelled.rs:4:5
87
+ |
88
+ LL | 'while_loop: while true {
89
+ | ^^^^^^^^^^^
90
+ |
91
+ note: the lint level is defined here
92
+ --> $DIR/label_misspelled.rs:1:9
93
+ |
94
+ LL | #![warn(unused_labels)]
95
+ | ^^^^^^^^^^^^^
96
+
77
97
warning: denote infinite loops with `loop { ... }`
78
- --> $DIR/label_misspelled.rs:2 :5
98
+ --> $DIR/label_misspelled.rs:4 :5
79
99
|
80
100
LL | 'while_loop: while true {
81
101
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
82
102
|
83
103
= note: `#[warn(while_true)]` on by default
84
104
105
+ warning: unused label
106
+ --> $DIR/label_misspelled.rs:9:5
107
+ |
108
+ LL | 'while_let: while let Some(_) = Some(()) {
109
+ | ^^^^^^^^^^
110
+
111
+ warning: unused label
112
+ --> $DIR/label_misspelled.rs:14:5
113
+ |
114
+ LL | 'for_loop: for _ in 0..3 {
115
+ | ^^^^^^^^^
116
+
117
+ warning: unused label
118
+ --> $DIR/label_misspelled.rs:19:5
119
+ |
120
+ LL | 'LOOP: loop {
121
+ | ^^^^^
122
+
123
+ warning: unused label
124
+ --> $DIR/label_misspelled.rs:27:5
125
+ |
126
+ LL | 'LOOP: loop {
127
+ | ^^^^^
128
+
129
+ warning: unused label
130
+ --> $DIR/label_misspelled.rs:32:5
131
+ |
132
+ LL | 'while_loop: while true {
133
+ | ^^^^^^^^^^^
134
+
85
135
warning: denote infinite loops with `loop { ... }`
86
- --> $DIR/label_misspelled.rs:25 :5
136
+ --> $DIR/label_misspelled.rs:32 :5
87
137
|
88
138
LL | 'while_loop: while true {
89
139
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
90
140
141
+ warning: unused label
142
+ --> $DIR/label_misspelled.rs:37:5
143
+ |
144
+ LL | 'while_let: while let Some(_) = Some(()) {
145
+ | ^^^^^^^^^^
146
+
147
+ warning: unused label
148
+ --> $DIR/label_misspelled.rs:42:5
149
+ |
150
+ LL | 'for_loop: for _ in 0..3 {
151
+ | ^^^^^^^^^
152
+
153
+ warning: unused label
154
+ --> $DIR/label_misspelled.rs:51:5
155
+ |
156
+ LL | 'while_loop: while true {
157
+ | ^^^^^^^^^^^
158
+
91
159
warning: denote infinite loops with `loop { ... }`
92
- --> $DIR/label_misspelled.rs:41 :5
160
+ --> $DIR/label_misspelled.rs:51 :5
93
161
|
94
162
LL | 'while_loop: while true {
95
163
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
96
164
165
+ warning: unused label
166
+ --> $DIR/label_misspelled.rs:56:5
167
+ |
168
+ LL | 'while_let: while let Some(_) = Some(()) {
169
+ | ^^^^^^^^^^
170
+
171
+ warning: unused label
172
+ --> $DIR/label_misspelled.rs:61:5
173
+ |
174
+ LL | 'for_loop: for _ in 0..3 {
175
+ | ^^^^^^^^^
176
+
97
177
error[E0571]: `break` with value from a `while` loop
98
- --> $DIR/label_misspelled.rs:42 :9
178
+ --> $DIR/label_misspelled.rs:53 :9
99
179
|
100
180
LL | 'while_loop: while true {
101
181
| ----------------------- you can't `break` with a value in a `while` loop
182
+ LL |
102
183
LL | break foo;
103
184
| ^^^^^^^^^ can only break with a value inside `loop` or breakable block
104
185
|
@@ -112,10 +193,11 @@ LL | break 'while_loop;
112
193
| ^^^^^^^^^^^
113
194
114
195
error[E0571]: `break` with value from a `while` loop
115
- --> $DIR/label_misspelled.rs:46 :9
196
+ --> $DIR/label_misspelled.rs:58 :9
116
197
|
117
198
LL | 'while_let: while let Some(_) = Some(()) {
118
199
| ---------------------------------------- you can't `break` with a value in a `while` loop
200
+ LL |
119
201
LL | break foo;
120
202
| ^^^^^^^^^ can only break with a value inside `loop` or breakable block
121
203
|
@@ -129,10 +211,11 @@ LL | break 'while_let;
129
211
| ^^^^^^^^^^
130
212
131
213
error[E0571]: `break` with value from a `for` loop
132
- --> $DIR/label_misspelled.rs:50 :9
214
+ --> $DIR/label_misspelled.rs:63 :9
133
215
|
134
216
LL | 'for_loop: for _ in 0..3 {
135
217
| ------------------------ you can't `break` with a value in a `for` loop
218
+ LL |
136
219
LL | break foo;
137
220
| ^^^^^^^^^ can only break with a value inside `loop` or breakable block
138
221
|
@@ -145,7 +228,7 @@ help: alternatively, you might have meant to use the available loop label
145
228
LL | break 'for_loop;
146
229
| ^^^^^^^^^
147
230
148
- error: aborting due to 11 previous errors; 3 warnings emitted
231
+ error: aborting due to 11 previous errors; 14 warnings emitted
149
232
150
233
Some errors have detailed explanations: E0425, E0571.
151
234
For more information about an error, try `rustc --explain E0425`.
0 commit comments