]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/loop-labeled-break-value.rs:3:29 |
b7449926 | 3 | | |
532ac7d7 | 4 | LL | let _: i32 = loop { break }; |
781aab86 FG |
5 | | - ---- ^^^^^ expected `i32`, found `()` |
6 | | | | | |
7 | | | this loop is expected to be of type `i32` | |
8 | | expected because of this assignment | |
9 | | | |
10 | help: give it a value of the expected type | |
11 | | | |
12 | LL | let _: i32 = loop { break 42 }; | |
13 | | ++ | |
b7449926 XL |
14 | |
15 | error[E0308]: mismatched types | |
0731742a | 16 | --> $DIR/loop-labeled-break-value.rs:6:37 |
b7449926 | 17 | | |
532ac7d7 | 18 | LL | let _: i32 = 'inner: loop { break 'inner }; |
781aab86 FG |
19 | | - ---- ^^^^^^^^^^^^ expected `i32`, found `()` |
20 | | | | | |
21 | | | this loop is expected to be of type `i32` | |
22 | | expected because of this assignment | |
23 | | | |
24 | help: give it a value of the expected type | |
25 | | | |
26 | LL | let _: i32 = 'inner: loop { break 'inner 42 }; | |
27 | | ++ | |
b7449926 XL |
28 | |
29 | error[E0308]: mismatched types | |
0731742a | 30 | --> $DIR/loop-labeled-break-value.rs:9:45 |
b7449926 | 31 | | |
532ac7d7 | 32 | LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } }; |
781aab86 FG |
33 | | - ---- ^^^^^^^^^^^^^ expected `i32`, found `()` |
34 | | | | | |
35 | | | this loop is expected to be of type `i32` | |
36 | | expected because of this assignment | |
37 | | | |
38 | help: give it a value of the expected type | |
39 | | | |
40 | LL | let _: i32 = 'inner2: loop { loop { break 'inner2 42 } }; | |
41 | | ++ | |
b7449926 XL |
42 | |
43 | error: aborting due to 3 previous errors | |
44 | ||
45 | For more information about this error, try `rustc --explain E0308`. |