fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.5 KiB39 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   |
10   = note: expected type `i32`
11              found type `()`
12
13error[E0308]: mismatched types
14  --> $DIR/loop-labeled-break-value.rs:6:37
15   |
16LL |         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 type `()`
24
25error[E0308]: mismatched types
26  --> $DIR/loop-labeled-break-value.rs:9:45
27   |
28LL |         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 type `()`
36
37error: aborting due to 3 previous errors
38
39For more information about this error, try `rustc --explain E0308`.