Skip to content

Commit 1b87837

Browse files
committed
Clarify that //! comments are also doc comments.
1 parent 65f8899 commit 1b87837

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/doc/reference.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ sequence (`/**`), are interpreted as a special syntax for `doc`
149149
`#[doc="..."]` around the body of the comment (this includes the comment
150150
characters themselves, ie `/// Foo` turns into `#[doc="/// Foo"]`).
151151

152-
`//!` comments apply to the parent of the comment, rather than the item that
153-
follows. `//!` comments are usually used to display information on the crate
154-
index page.
152+
Line comments beginning with `//!` are doc comments that apply to the parent
153+
of the comment, rather than the item that follows. That is, they are
154+
equivalent to writing `#![doc="..."]` around the body of the comment. `//!`
155+
comments are usually used to display information on the crate index page.
155156

156157
Non-doc comments are interpreted as a form of whitespace.
157158

0 commit comments

Comments
 (0)