You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comments follow the general C++ style of line (`//`) and block (`/* ... */`) comment forms. Nested block comments are supported.
44
43
45
44
r[comments.normal.tokenization]
46
45
Non-doc comments are interpreted as a form of whitespace.
@@ -49,25 +48,16 @@ r[comments.doc]
49
48
## Doc comments
50
49
51
50
r[comments.doc.syntax]
52
-
Line doc comments beginning with exactly _three_ slashes (`///`), and block
53
-
doc comments (`/** ... */`), both outer doc comments, are interpreted as a
54
-
special syntax for [`doc` attributes].
51
+
Line doc comments beginning with exactly _three_ slashes (`///`), and block doc comments (`/** ... */`), both outer doc comments, are interpreted as a special syntax for [`doc` attributes].
55
52
56
53
r[comments.doc.attributes]
57
-
That is, they are equivalent to writing
58
-
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
59
-
`#[doc="Foo"]` and `/** Bar */` turns into `#[doc="Bar"]`. They must therefore
60
-
appear before something that accepts an outer attribute.
54
+
That is, they are equivalent to writing `#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into `#[doc="Foo"]` and `/** Bar */` turns into `#[doc="Bar"]`. They must therefore appear before something that accepts an outer attribute.
61
55
62
56
r[comments.doc.inner-syntax]
63
-
Line comments beginning with `//!` and block comments `/*! ... */` are
64
-
doc comments that apply to the parent of the comment, rather than the item
65
-
that follows.
57
+
Line comments beginning with `//!` and block comments `/*! ... */` are doc comments that apply to the parent of the comment, rather than the item that follows.
66
58
67
59
r[comments.doc.inner-attributes]
68
-
That is, they are equivalent to writing `#![doc="..."]` around
69
-
the body of the comment. `//!` comments are usually used to document
70
-
modules that occupy a source file.
60
+
That is, they are equivalent to writing `#![doc="..."]` around the body of the comment. `//!` comments are usually used to document modules that occupy a source file.
71
61
72
62
r[comments.doc.bare-crs]
73
63
The character `U+000D` (CR) is not allowed in doc comments.
Copy file name to clipboardExpand all lines: src/input-format.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,7 @@ If the first character in the sequence is `U+FEFF` ([BYTE ORDER MARK]), it is re
30
30
r[input.crlf]
31
31
## CRLF normalization
32
32
33
-
Each pair of characters `U+000D` (CR) immediately followed by `U+000A` (LF) is replaced by a single `U+000A` (LF).
34
-
This happens once, not repeatedly, so after the normalization, there can still exist `U+000D` (CR) immediately followed by `U+000A` (LF) in the input (e.g. if the raw input contained "CR CR LF LF").
33
+
Each pair of characters `U+000D` (CR) immediately followed by `U+000A` (LF) is replaced by a single `U+000A` (LF). This happens once, not repeatedly, so after the normalization, there can still exist `U+000D` (CR) immediately followed by `U+000A` (LF) in the input (e.g. if the raw input contained "CR CR LF LF").
35
34
36
35
Other occurrences of the character `U+000D` (CR) are left in place (they are treated as [whitespace]).
37
36
@@ -53,8 +52,7 @@ fn main() {
53
52
```
54
53
55
54
r[input.shebang.inner-attribute]
56
-
As an exception, if the `#!` characters are followed (ignoring intervening [comments] or [whitespace]) by a `[` token, nothing is removed.
57
-
This prevents an [inner attribute] at the start of a source file being removed.
55
+
As an exception, if the `#!` characters are followed (ignoring intervening [comments] or [whitespace]) by a `[` token, nothing is removed. This prevents an [inner attribute] at the start of a source file being removed.
58
56
59
57
> [!NOTE]
60
58
> The standard library [`include!`] macro applies byte order mark removal, CRLF normalization, and shebang removal to the file it reads. The [`include_str!`] and [`include_bytes!`] macros do not.
Copy file name to clipboardExpand all lines: src/keywords.md
+5-12Lines changed: 5 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,7 @@ r[lex.keywords.strict]
11
11
## Strict keywords
12
12
13
13
r[lex.keywords.strict.intro]
14
-
These keywords can only be used in their correct contexts. They cannot
15
-
be used as the names of:
14
+
These keywords can only be used in their correct contexts. They cannot be used as the names of:
16
15
17
16
*[Items]
18
17
*[Variables] and function parameters
@@ -78,10 +77,7 @@ r[lex.keywords.reserved]
78
77
## Reserved keywords
79
78
80
79
r[lex.keywords.reserved.intro]
81
-
These keywords aren't used yet, but they are reserved for future use. They have
82
-
the same restrictions as strict keywords. The reasoning behind this is to make
83
-
current programs forward compatible with future versions of Rust by forbidding
84
-
them to use these keywords.
80
+
These keywords aren't used yet, but they are reserved for future use. They have the same restrictions as strict keywords. The reasoning behind this is to make current programs forward compatible with future versions of Rust by forbidding them to use these keywords.
85
81
86
82
r[lex.keywords.reserved.list]
87
83
-`abstract`
@@ -111,8 +107,7 @@ r[lex.keywords.weak]
111
107
## Weak keywords
112
108
113
109
r[lex.keywords.weak.intro]
114
-
These keywords have special meaning only in certain contexts. For example, it
115
-
is possible to declare a variable or method with the name `union`.
110
+
These keywords have special meaning only in certain contexts. For example, it is possible to declare a variable or method with the name `union`.
0 commit comments