mirror of https://github.com/rust-lang/rust
19 lines
583 B
Plaintext
19 lines
583 B
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/type-error-break-tail.rs:3:20
|
|
|
|
|
LL | fn loop_ending() -> i32 {
|
|
| --- expected `i32` because of this return type
|
|
LL | loop {
|
|
| ---- this loop is expected to be of type `i32`
|
|
LL | if false { break; }
|
|
| ^^^^^ expected `i32`, found `()`
|
|
|
|
|
help: give the `break` a value of the expected type
|
|
|
|
|
LL | if false { break 42; }
|
|
| ++
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|