2020-09-29 01:03:02 +01:00
|
|
|
error[E0308]: mismatched types
|
2020-10-21 22:52:41 +01:00
|
|
|
--> $DIR/break-diverging-value.rs:11:26
|
2020-09-29 01:03:02 +01:00
|
|
|
|
|
|
|
|
LL | fn loop_break_break() -> i32 {
|
|
|
|
| ---------------- ^^^ expected `i32`, found `()`
|
|
|
|
| |
|
|
|
|
| implicitly returns `()` as its body has no tail or `return` expression
|
|
|
|
|
2020-10-21 22:52:41 +01:00
|
|
|
error[E0069]: `return;` in a function whose return type is not `()`
|
|
|
|
--> $DIR/break-diverging-value.rs:16:37
|
|
|
|
|
|
|
|
|
LL | let loop_value = loop { break { return; () } };
|
|
|
|
| ^^^^^^ return type is not `()`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/break-diverging-value.rs:15:29
|
|
|
|
|
|
|
|
|
LL | fn loop_break_return_2() -> i32 {
|
|
|
|
| ------------------- ^^^ expected `i32`, found `()`
|
|
|
|
| |
|
|
|
|
| implicitly returns `()` as its body has no tail or `return` expression
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/break-diverging-value.rs:26:25
|
|
|
|
|
|
|
|
|
LL | fn loop_break_void() -> i32 {
|
|
|
|
| --------------- ^^^ expected `i32`, found `()`
|
|
|
|
| |
|
|
|
|
| implicitly returns `()` as its body has no tail or `return` expression
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2020-09-29 01:03:02 +01:00
|
|
|
|
2020-10-21 22:52:41 +01:00
|
|
|
Some errors have detailed explanations: E0069, E0308.
|
|
|
|
For more information about an error, try `rustc --explain E0069`.
|