File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -153,16 +153,21 @@ which must be _escaped_ by a preceding `U+005C` character (`\`).
153
153
Line-breaks are allowed in string literals. A line-break is either a newline
154
154
(` U+000A ` ) or a pair of carriage return and newline (` U+000D ` , ` U+000A ` ). Both
155
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, then 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:
156
+ when an unescaped ` U+005C ` character (` \ ` ) occurs immediately before a ` \n `
157
+ (` U+000A ` ), then the ` U+005C ` character, and all immediately following
158
+ ` ` (` U+0020 ` ), ` \t ` (` U+0009 ` ), ` \n ` (` U+000A ` ) and ` \r ` (` U+0000D ` ) characters
159
+ are ignored. Thus ` a ` , ` b ` and ` c ` are equal:
159
160
160
161
``` rust
161
162
let a = " foobar" ;
162
163
let b = " foo\
163
164
bar" ;
165
+ let c = " foo\
164
166
165
- assert_eq! (a ,b );
167
+ bar" ;
168
+
169
+ assert_eq! (a , b );
170
+ assert_eq! (b , c );
166
171
```
167
172
168
173
#### Character escapes
You can’t perform that action at this time.
0 commit comments