Skip to content

Commit 968e8bf

Browse files
committed
Auto merge of #29819 - mdinger:block-comments, r=steveklabnik
These really aren't documented well at all. The fact that doc comments end on a `*/` is really weird. I'm not sure if this is a mistake or not though. None of the block comments are even mentioned in the [book nightly](http://doc.rust-lang.org/nightly/book/comments.html). Probably should be fixed.
2 parents 929ca3c + 4e74f9b commit 968e8bf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/doc/reference.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,12 @@ Comments in Rust code follow the general C++ style of line (`//`) and
9999
block (`/* ... */`) comment forms. Nested block comments are supported.
100100

101101
Line comments beginning with exactly _three_ slashes (`///`), and block
102-
comments beginning with exactly one repeated asterisk in the block-open
103-
sequence (`/**`), are interpreted as a special syntax for `doc`
102+
comments (`/** ... */`), are interpreted as a special syntax for `doc`
104103
[attributes](#attributes). That is, they are equivalent to writing
105104
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
106105
`#[doc="Foo"]`.
107106

108-
Line comments beginning with `//!` and block comments beginning with `/*!` are
107+
Line comments beginning with `//!` and block comments `/*! ... !*/` are
109108
doc comments that apply to the parent of the comment, rather than the item
110109
that follows. That is, they are equivalent to writing `#![doc="..."]` around
111110
the body of the comment. `//!` comments are usually used to document

0 commit comments

Comments
 (0)