We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 258115e commit f847211Copy full SHA for f847211
compiler/rustc_lexer/src/unescape.rs
@@ -356,10 +356,9 @@ where
356
let start = src.len() - chars.as_str().len() - c.len_utf8();
357
let res = match c {
358
'\\' => {
359
- let mut chars_clone = chars.clone();
360
- match chars_clone.next() {
361
- Some('\n') => {
362
- chars = chars_clone;
+ match chars.as_str().as_bytes().get(1) {
+ Some(b'\n') => {
+ let _ = chars.next();
363
// Rust language specification requires us to skip whitespaces
364
// if unescaped '\' character is followed by '\n'.
365
// For details see [Rust language reference]
0 commit comments