about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-10-18 13:48:24 -0700
committerGitHub <noreply@github.com>2019-10-18 13:48:24 -0700
commite27e39b7b20c4e4962a5ba0ab94dc68c6a3ed30c (patch)
tree8b6c158a8f566e3ca281560390ecf3d789d81ec4
parentc6bb96005e87d218b25cdf4afad94593a1e549fa (diff)
parentf647c06120150bb26c843a5eaa65caf5c336b51a (diff)
downloadrust-e27e39b7b20c4e4962a5ba0ab94dc68c6a3ed30c.tar.gz
rust-e27e39b7b20c4e4962a5ba0ab94dc68c6a3ed30c.zip
Rollup merge of #65493 - GuillaumeGomez:long-err-explanation-E0584, r=kinnison
Add long error explanation for E0584

Part of #61137.

r? @kinnison
-rw-r--r--src/libsyntax/error_codes.rs28
-rw-r--r--src/test/ui/mod/mod_file_disambig.stderr1
-rw-r--r--src/test/ui/parser/doc-inside-trait-item.stderr1
3 files changed, 29 insertions, 1 deletions
diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs
index fc3f095856a..17ea4767520 100644
--- a/src/libsyntax/error_codes.rs
+++ b/src/libsyntax/error_codes.rs
@@ -295,6 +295,33 @@ named `file_that_doesnt_exist.rs` or `file_that_doesnt_exist/mod.rs` in the
 same directory.
 "##,
 
+E0584: r##"
+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();
+}
+```
+"##,
+
 E0585: r##"
 A documentation comment that doesn't document anything was found.
 
@@ -494,7 +521,6 @@ features in the `-Z allow_features` flag.
     E0549,
     E0553, // multiple rustc_const_unstable attributes
 //  E0555, // replaced with a generic attribute input check
-    E0584, // file for module `..` found at both .. and ..
     E0629, // missing 'feature' (rustc_const_unstable)
     // rustc_const_unstable attribute must be paired with stable/unstable
     // attribute
diff --git a/src/test/ui/mod/mod_file_disambig.stderr b/src/test/ui/mod/mod_file_disambig.stderr
index 27df0241aa2..2b77d866fb3 100644
--- a/src/test/ui/mod/mod_file_disambig.stderr
+++ b/src/test/ui/mod/mod_file_disambig.stderr
@@ -8,3 +8,4 @@ LL | mod mod_file_disambig_aux;
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0584`.
diff --git a/src/test/ui/parser/doc-inside-trait-item.stderr b/src/test/ui/parser/doc-inside-trait-item.stderr
index 3287ece9ae6..261e27b6e0d 100644
--- a/src/test/ui/parser/doc-inside-trait-item.stderr
+++ b/src/test/ui/parser/doc-inside-trait-item.stderr
@@ -8,3 +8,4 @@ LL |     /// empty doc
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0584`.