The compiler found a function whose body contains a return; statement but whose return type is not ().
Erroneous code example:
#![allow(unused)]
fn main() {
// error
fn foo() -> u8 {
return;
}
} Since return; is just like return ();, there is a mismatch between the function's return type and the value being returned.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0069.html