rust/src/test/ui/break-diverging-value.stderr

35 lines
1.2 KiB
Plaintext
Raw Normal View History

error[E0308]: mismatched types
2020-10-21 23:52:41 +02:00
--> $DIR/break-diverging-value.rs:11:26
|
LL | fn loop_break_break() -> i32 {
| ---------------- ^^^ expected `i32`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
2020-10-21 23:52:41 +02: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-10-21 23:52:41 +02:00
Some errors have detailed explanations: E0069, E0308.
For more information about an error, try `rustc --explain E0069`.