1 error[E0425]: cannot find value `LOOP` in this scope
2 --> $DIR/loop-break-value.rs:95:15
4 LL | 'LOOP: for _ in 0 .. 9 {
5 | ----- a label with a similar name exists
9 | not found in this scope
10 | help: use the similarly named label: `'LOOP`
12 warning: denote infinite loops with `loop { ... }`
13 --> $DIR/loop-break-value.rs:26:5
15 LL | 'while_loop: while true {
16 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
18 = note: `#[warn(while_true)]` on by default
20 error[E0571]: `break` with value from a `while` loop
21 --> $DIR/loop-break-value.rs:28:9
23 LL | 'while_loop: while true {
24 | ----------------------- you can't `break` with a value in a `while` loop
27 | ^^^^^^^^ can only break with a value inside `loop` or breakable block
29 help: use `break` on its own without a value inside this `while` loop
33 help: alternatively, you might have meant to use the available loop label
35 LL | break 'while_loop;
38 error[E0571]: `break` with value from a `while` loop
39 --> $DIR/loop-break-value.rs:30:13
41 LL | 'while_loop: while true {
42 | ----------------------- you can't `break` with a value in a `while` loop
44 LL | break 'while_loop 123;
45 | ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
47 help: use `break` on its own without a value inside this `while` loop
49 LL | break 'while_loop;
52 error[E0571]: `break` with value from a `while` loop
53 --> $DIR/loop-break-value.rs:38:12
55 LL | while let Some(_) = Some(()) {
56 | ---------------------------- you can't `break` with a value in a `while` loop
58 | ^^^^^^^^ can only break with a value inside `loop` or breakable block
60 help: use `break` on its own without a value inside this `while` loop
65 error[E0571]: `break` with value from a `while` loop
66 --> $DIR/loop-break-value.rs:43:9
68 LL | while let Some(_) = Some(()) {
69 | ---------------------------- you can't `break` with a value in a `while` loop
71 | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
73 help: use `break` on its own without a value inside this `while` loop
78 error[E0571]: `break` with value from a `while` loop
79 --> $DIR/loop-break-value.rs:49:13
81 LL | 'while_let_loop: while let Some(_) = Some(()) {
82 | --------------------------------------------- you can't `break` with a value in a `while` loop
84 LL | break 'while_let_loop "nope";
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
87 help: use `break` on its own without a value inside this `while` loop
89 LL | break 'while_let_loop;
90 | ~~~~~~~~~~~~~~~~~~~~~
92 error[E0571]: `break` with value from a `for` loop
93 --> $DIR/loop-break-value.rs:56:9
95 LL | for _ in &[1,2,3] {
96 | ----------------- you can't `break` with a value in a `for` loop
98 | ^^^^^^^^ can only break with a value inside `loop` or breakable block
100 help: use `break` on its own without a value inside this `for` loop
105 error[E0571]: `break` with value from a `for` loop
106 --> $DIR/loop-break-value.rs:57:9
108 LL | for _ in &[1,2,3] {
109 | ----------------- you can't `break` with a value in a `for` loop
112 | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
114 help: use `break` on its own without a value inside this `for` loop
119 error[E0571]: `break` with value from a `for` loop
120 --> $DIR/loop-break-value.rs:64:13
122 LL | 'for_loop: for _ in &[1,2,3] {
123 | ---------------------------- you can't `break` with a value in a `for` loop
125 LL | break 'for_loop Some(17);
126 | ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
128 help: use `break` on its own without a value inside this `for` loop
130 LL | break 'for_loop;
133 error[E0308]: mismatched types
134 --> $DIR/loop-break-value.rs:4:31
136 LL | let val: ! = loop { break break; };
137 | ^^^^^ expected `!`, found `()`
139 = note: expected type `!`
142 error[E0308]: mismatched types
143 --> $DIR/loop-break-value.rs:11:19
146 | ^^^ expected `&str`, found integer
148 error[E0308]: mismatched types
149 --> $DIR/loop-break-value.rs:16:15
152 | ^^^^^^ expected `i32`, found `&str`
154 error[E0308]: mismatched types
155 --> $DIR/loop-break-value.rs:21:31
157 LL | break 'outer_loop "nope";
158 | ^^^^^^ expected `i32`, found `&str`
160 error[E0308]: mismatched types
161 --> $DIR/loop-break-value.rs:73:26
164 | ^^^ expected `()`, found integer
166 error[E0308]: mismatched types
167 --> $DIR/loop-break-value.rs:80:15
169 LL | break (break, break);
170 | ^^^^^^^^^^^^^^ expected `()`, found tuple
172 = note: expected unit type `()`
175 error[E0308]: mismatched types
176 --> $DIR/loop-break-value.rs:85:15
179 | ^ expected `()`, found integer
181 error[E0308]: mismatched types
182 --> $DIR/loop-break-value.rs:90:9
187 | expected integer, found `()`
188 | help: give it a value of the expected type: `break value`
190 error: aborting due to 17 previous errors; 1 warning emitted
192 Some errors have detailed explanations: E0308, E0425, E0571.
193 For more information about an error, try `rustc --explain E0308`.