|
1 | 1 | error[E0308]: mismatched types
|
2 |
| - --> $DIR/break-diverging-value.rs:9:26 |
| 2 | + --> $DIR/break-diverging-value.rs:11:26 |
3 | 3 | |
|
4 | 4 | LL | fn loop_break_break() -> i32 {
|
5 | 5 | | ---------------- ^^^ expected `i32`, found `()`
|
6 | 6 | | |
|
7 | 7 | | implicitly returns `()` as its body has no tail or `return` expression
|
8 | 8 |
|
9 |
| -error: aborting due to previous error |
| 9 | +error[E0069]: `return;` in a function whose return type is not `()` |
| 10 | + --> $DIR/break-diverging-value.rs:16:37 |
| 11 | + | |
| 12 | +LL | let loop_value = loop { break { return; () } }; |
| 13 | + | ^^^^^^ return type is not `()` |
| 14 | + |
| 15 | +error[E0308]: mismatched types |
| 16 | + --> $DIR/break-diverging-value.rs:15:29 |
| 17 | + | |
| 18 | +LL | fn loop_break_return_2() -> i32 { |
| 19 | + | ------------------- ^^^ expected `i32`, found `()` |
| 20 | + | | |
| 21 | + | implicitly returns `()` as its body has no tail or `return` expression |
| 22 | + |
| 23 | +error[E0308]: mismatched types |
| 24 | + --> $DIR/break-diverging-value.rs:26:25 |
| 25 | + | |
| 26 | +LL | fn loop_break_void() -> i32 { |
| 27 | + | --------------- ^^^ expected `i32`, found `()` |
| 28 | + | | |
| 29 | + | implicitly returns `()` as its body has no tail or `return` expression |
| 30 | + |
| 31 | +error: aborting due to 4 previous errors |
10 | 32 |
|
11 |
| -For more information about this error, try `rustc --explain E0308`. |
| 33 | +Some errors have detailed explanations: E0069, E0308. |
| 34 | +For more information about an error, try `rustc --explain E0069`. |
0 commit comments