Skip to content

Commit 0ea193d

Browse files
author
Robin Kruppe
committed
Reference audit: comments and whitespace sections
1 parent 85ee89a commit 0ea193d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/doc/reference.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,32 @@ that does _not_ occur in the set of [keywords](#keywords).
8383
8484
## Comments
8585

86-
Comments in Rust code follow the general C++ style of line and block-comment
87-
forms. Nested block comments are supported.
86+
Comments in Rust code follow the general C++ style of line (`//`) and
87+
block-comment (`/* ... */`) forms. Nested block comments are supported.
8888

8989
Line comments beginning with exactly _three_ slashes (`///`), and block
9090
comments beginning with exactly one repeated asterisk in the block-open
9191
sequence (`/**`), are interpreted as a special syntax for `doc`
9292
[attributes](#attributes). That is, they are equivalent to writing
93-
`#[doc="..."]` around the body of the comment (this includes the comment
94-
characters themselves, i.e. `/// Foo` turns into `#[doc="/// Foo"]`).
93+
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
94+
`#[doc="Foo"]`.
9595

9696
Line comments beginning with `//!` and block comments beginning with `/*!` are
9797
doc comments that apply to the parent of the comment, rather than the item
9898
that follows. That is, they are equivalent to writing `#![doc="..."]` around
99-
the body of the comment. `//!` comments are usually used to display
100-
information on the crate index page.
99+
the body of the comment. `//!` comments are usually used to document
100+
modules that occupy a source file.
101101

102102
Non-doc comments are interpreted as a form of whitespace.
103103

104104
## Whitespace
105105

106-
The `whitespace_char` production is any nonempty Unicode string consisting of
107-
any of the following Unicode characters: `U+0020` (space, `' '`), `U+0009`
108-
(tab, `'\t'`), `U+000A` (LF, `'\n'`), `U+000D` (CR, `'\r'`).
106+
Whitespace is any non-empty string containing any the following characters:
107+
108+
- `U+0020` (space, `' '`)
109+
- `U+0009` (tab, `'\t'`)
110+
- `U+000A` (LF, `'\n'`)
111+
- `U+000D` (CR, `'\r'`)
109112

110113
Rust is a "free-form" language, meaning that all forms of whitespace serve only
111114
to separate _tokens_ in the grammar, and have no semantic significance.

0 commit comments

Comments
 (0)