about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-04-22 11:08:50 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-04-22 11:08:50 +0200
commit3390ff97b22e082bb553cc0f175ae5ca18bd5e60 (patch)
tree01761c04aa67f97140bae68bb709483f1ab3ba24 /src/librustc_error_codes/error_codes
parent2dc5b602eee35d70e8e6e506a7ea07b6c7e0197d (diff)
downloadrust-3390ff97b22e082bb553cc0f175ae5ca18bd5e60.tar.gz
rust-3390ff97b22e082bb553cc0f175ae5ca18bd5e60.zip
Add error code to inner doc comment attribute error
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0753.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0753.md b/src/librustc_error_codes/error_codes/E0753.md
new file mode 100644
index 00000000000..a69da964aee
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0753.md
@@ -0,0 +1,31 @@
+An inner doc comment was used in an invalid context.
+
+Erroneous code example:
+
+```compile_fail,E0753
+fn foo() {}
+//! foo
+// ^ error!
+fn main() {}
+```
+
+Inner document can only be used before items. For example:
+
+```
+//! A working comment applied to the module!
+fn foo() {
+    //! Another working comment!
+}
+fn main() {}
+```
+
+In case you want to document the item following the doc comment, you might want
+to use outer doc comment:
+
+```
+/// I am an outer doc comment
+#[doc = "I am also an outer doc comment!"]
+fn foo() {
+    // ...
+}
+```