summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0584.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0584.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0584.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0584.md b/compiler/rustc_error_codes/src/error_codes/E0584.md
new file mode 100644
index 000000000..8b00655ee
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0584.md
@@ -0,0 +1,24 @@
+A doc comment that is not attached to anything has been encountered.
+
+Erroneous code example:
+
+```compile_fail,E0584
+trait Island {
+ fn lost();
+
+ /// I'm lost!
+}
+```
+
+A little reminder: a doc comment has to be placed before the item it's supposed
+to document. So if you want to document the `Island` trait, you need to put a
+doc comment before it, not inside it. Same goes for the `lost` method: the doc
+comment needs to be before it:
+
+```
+/// I'm THE island!
+trait Island {
+ /// I'm lost!
+ fn lost();
+}
+```