summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0069.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0069.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0069.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0069.md b/compiler/rustc_error_codes/src/error_codes/E0069.md
new file mode 100644
index 000000000..7367a5c09
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0069.md
@@ -0,0 +1,14 @@
+The compiler found a function whose body contains a `return;` statement but
+whose return type is not `()`.
+
+Erroneous code example:
+
+```compile_fail,E0069
+// 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.