Skip to content

Commit f883762

Browse files
committed
Remove explicit \n and \t handling in unescape_str_common.
The fallback `_` case works for these chars, no need to treat them specially.
1 parent 08b8ba0 commit f883762

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

compiler/rustc_lexer/src/unescape.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ where
351351
_ => scan_escape::<T>(&mut chars, mode),
352352
}
353353
}
354-
'\n' => Ok(b'\n'.into()),
355-
'\t' => Ok(b'\t'.into()),
356354
'"' => Err(EscapeError::EscapeOnlyChar),
357355
'\r' => Err(EscapeError::BareCarriageReturn),
358356
_ => ascii_check(c, mode.characters_should_be_ascii()).map(Into::into),

0 commit comments

Comments
 (0)