@@ -92,7 +92,7 @@ A suffix is a non-raw identifier immediately (without whitespace)
92
92
following the primary part of a literal.
93
93
94
94
Any kind of literal (string, integer, etc) with any suffix is valid as a token,
95
- and can be passed to a macro without producing an error.
95
+ and can be passed to a macro without producing an error.
96
96
The macro itself will decide how to interpret such a token and whether to produce an error or not.
97
97
98
98
``` rust
@@ -101,7 +101,7 @@ macro_rules! blackhole { ($tt:tt) => () }
101
101
blackhole! (" string" suffix ); // OK
102
102
```
103
103
104
- However, suffixes on literal tokens parsed as Rust code are restricted.
104
+ However, suffixes on literal tokens parsed as Rust code are restricted.
105
105
Any suffixes are rejected on non-numeric literal tokens,
106
106
and numeric literal tokens are accepted only with suffixes from the list below.
107
107
@@ -150,11 +150,12 @@ A _string literal_ is a sequence of any Unicode characters enclosed within two
150
150
` U+0022 ` (double-quote) characters, with the exception of ` U+0022 ` itself,
151
151
which must be _ escaped_ by a preceding ` U+005C ` character (` \ ` ).
152
152
153
- Line-break characters are allowed in string literals. Normally they represent
154
- themselves (i.e. no translation), but as a special exception, when an unescaped
155
- ` U+005C ` character (` \ ` ) occurs immediately before the newline (` U+000A ` ), the
156
- ` U+005C ` character, the newline, and all whitespace at the beginning of the
157
- next line are ignored. Thus ` a ` and ` b ` are equal:
153
+ Line-breaks are allowed in string literals. A line-break is either a newline
154
+ (` U+000A ` ) or a pair of carriage return and newline (` U+000D ` , ` U+000A ` ). Both
155
+ byte sequences are normally translated to ` U+000A ` , but as a special exception,
156
+ when an unescaped ` U+005C ` character (` \ ` ) occurs immediately before the
157
+ line-break, the ` U+005C ` character, the line-break, and all whitespace at the
158
+ beginning of the next line are ignored. Thus ` a ` and ` b ` are equal:
158
159
159
160
``` rust
160
161
let a = " foobar" ;
0 commit comments