]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0753.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0753.md
CommitLineData
f9f354fc
XL
1An inner doc comment was used in an invalid context.
2
3Erroneous code example:
4
5```compile_fail,E0753
6fn foo() {}
7//! foo
8// ^ error!
9fn main() {}
10```
11
12Inner document can only be used before items. For example:
13
14```
15//! A working comment applied to the module!
16fn foo() {
17 //! Another working comment!
18}
19fn main() {}
20```
21
22In case you want to document the item following the doc comment, you might want
23to use outer doc comment:
24
25```
26/// I am an outer doc comment
27#[doc = "I am also an outer doc comment!"]
28fn foo() {
29 // ...
30}
31```