Hi, I wanna know why do functions implicitly return an empty tuple ()
. This is given as a compile error when the value the function returns mismatches the return type defined.
fn main() {
do_something(1);
}
fn do_something(x: i32) -> i32 {
let x = 5;
}
A link that points to the rust-lang/rust repo page that depicts this functionality in the compiler will be greatly appreciated.
Thanks