]> git.lizzy.rs Git - rust.git/blob - src/test/ui/loops/loop-labeled-break-value.stderr
e34e7f4e956e21ce57a98275d65c018afbd4ced9
[rust.git] / src / test / ui / loops / loop-labeled-break-value.stderr
1 error[E0308]: mismatched types
2   --> $DIR/loop-labeled-break-value.rs:3:29
3    |
4 LL |         let _: i32 = loop { break };
5    |                             ^^^^^
6    |                             |
7    |                             expected i32, found ()
8    |                             help: give it a value of the expected type: `break 42`
9    |
10    = note:   expected type `i32`
11            found unit type `()`
12
13 error[E0308]: mismatched types
14   --> $DIR/loop-labeled-break-value.rs:6:37
15    |
16 LL |         let _: i32 = 'inner: loop { break 'inner };
17    |                                     ^^^^^^^^^^^^
18    |                                     |
19    |                                     expected i32, found ()
20    |                                     help: give it a value of the expected type: `break 'inner 42`
21    |
22    = note:   expected type `i32`
23            found unit type `()`
24
25 error[E0308]: mismatched types
26   --> $DIR/loop-labeled-break-value.rs:9:45
27    |
28 LL |         let _: i32 = 'inner2: loop { loop { break 'inner2 } };
29    |                                             ^^^^^^^^^^^^^
30    |                                             |
31    |                                             expected i32, found ()
32    |                                             help: give it a value of the expected type: `break 'inner2 42`
33    |
34    = note:   expected type `i32`
35            found unit type `()`
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0308`.