File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ Line doc comments beginning with exactly _three_ slashes (`///`), and block
45
45
doc comments (` /** ... */ ` ), both outer doc comments, are interpreted as a
46
46
special syntax for [ ` doc ` attributes] . That is, they are equivalent to writing
47
47
` #[doc="..."] ` around the body of the comment, i.e., ` /// Foo ` turns into
48
- ` #[doc="Foo"] ` and ` /** Bar */ ` turns into ` #[doc="Bar"] ` .
48
+ ` #[doc="Foo"] ` and ` /** Bar */ ` turns into ` #[doc="Bar"] ` . They must therefore
49
+ appear before something that accepts an outer attribute.
49
50
50
51
Line comments beginning with ` //! ` and block comments ` /*! ... */ ` are
51
52
doc comments that apply to the parent of the comment, rather than the item
@@ -55,6 +56,12 @@ modules that occupy a source file.
55
56
56
57
The character ` U+000D ` (CR) is not allowed in doc comments.
57
58
59
+ > ** Note** : It is conventional for doc comments to contain Markdown, as expected by
60
+ > ` rustdoc ` . However, the comment syntax does not respect any internal Markdown.
61
+ > `` /** `glob = "*/*.rs";` */ `` terminates the comment at the first ` */ ` , and the
62
+ > remaining code would cause a syntax error. This slightly limits the content of
63
+ > block doc comments compared to line doc comments.
64
+
58
65
> ** Note** : The sequence ` U+000D ` (CR) immediately followed by ` U+000A ` (LF) would have been previously transformed into a single ` U+000A ` (LF).
59
66
60
67
## Examples
You can’t perform that action at this time.
0 commit comments