fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.3 KiB30 linesraw
1error[E0308]: mismatched types
2  --> $DIR/loop-labeled-break-value.rs:3:29
3   |
4LL |         let _: i32 = loop { break };
5   |                             ^^^^^
6   |                             |
7   |                             expected `i32`, found `()`
8   |                             help: give it a value of the expected type: `break 42`
9
10error[E0308]: mismatched types
11  --> $DIR/loop-labeled-break-value.rs:6:37
12   |
13LL |         let _: i32 = 'inner: loop { break 'inner };
14   |                                     ^^^^^^^^^^^^
15   |                                     |
16   |                                     expected `i32`, found `()`
17   |                                     help: give it a value of the expected type: `break 'inner 42`
18
19error[E0308]: mismatched types
20  --> $DIR/loop-labeled-break-value.rs:9:45
21   |
22LL |         let _: i32 = 'inner2: loop { loop { break 'inner2 } };
23   |                                             ^^^^^^^^^^^^^
24   |                                             |
25   |                                             expected `i32`, found `()`
26   |                                             help: give it a value of the expected type: `break 'inner2 42`
27
28error: aborting due to 3 previous errors
29
30For more information about this error, try `rustc --explain E0308`.