]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0069.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0069.md
1 The compiler found a function whose body contains a `return;` statement but
2 whose return type is not `()`.
3
4 Erroneous code example:
5
6 ```compile_fail,E0069
7 // error
8 fn foo() -> u8 {
9     return;
10 }
11 ```
12
13 Since `return;` is just like `return ();`, there is a mismatch between the
14 function's return type and the value being returned.