E0036
Error
return without a value
ErrorA function with a return type returns a value of that type, so each return in it carries one.
Why
The caller waits for a value of the declared type. A bare return would leave it with nothing.
Broken
fn five() -> i64 {
return
}
fn main() {
print(five())
}
What sisu says
error[E0036]: `return` needs a value of type `i64` --> E0036.sisu:2:5 | 2 | return | ^^^^^^ sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0036
Fixed
fn five() -> i64 {
return 5
}
fn main() {
print(five())
}
Sisu