Fix an incorrect comment.

If a `\x` escape occurs in a non-byte literals (e.g. char literal,
string literal), it must be <= 0xff.
This commit is contained in:
Nicholas Nethercote 2022-09-27 15:25:34 +10:00
parent f3fafbb006
commit c91c64708b

View file

@ -184,7 +184,7 @@ fn scan_escape(chars: &mut Chars<'_>, mode: Mode) -> Result<char, EscapeError> {
let value = hi * 16 + lo;
// For a byte literal verify that it is within ASCII range.
// For a non-byte literal verify that it is within ASCII range.
if !mode.is_bytes() && !is_ascii(value) {
return Err(EscapeError::OutOfRangeHexEscape);
}