]> git.proxmox.com Git - rustc.git/blame - tests/ui/loops/loop-labeled-break-value.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / loops / loop-labeled-break-value.stderr
CommitLineData
b7449926 1error[E0308]: mismatched types
0731742a 2 --> $DIR/loop-labeled-break-value.rs:3:29
b7449926 3 |
532ac7d7 4LL | 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 |
10help: give it a value of the expected type
11 |
12LL | let _: i32 = loop { break 42 };
13 | ++
b7449926
XL
14
15error[E0308]: mismatched types
0731742a 16 --> $DIR/loop-labeled-break-value.rs:6:37
b7449926 17 |
532ac7d7 18LL | 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 |
24help: give it a value of the expected type
25 |
26LL | let _: i32 = 'inner: loop { break 'inner 42 };
27 | ++
b7449926
XL
28
29error[E0308]: mismatched types
0731742a 30 --> $DIR/loop-labeled-break-value.rs:9:45
b7449926 31 |
532ac7d7 32LL | 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 |
38help: give it a value of the expected type
39 |
40LL | let _: i32 = 'inner2: loop { loop { break 'inner2 42 } };
41 | ++
b7449926
XL
42
43error: aborting due to 3 previous errors
44
45For more information about this error, try `rustc --explain E0308`.