Skip to content

Commit c91c647

Browse files
committed
Fix an incorrect comment.
If a `\x` escape occurs in a non-byte literals (e.g. char literal, string literal), it must be <= 0xff.
1 parent f3fafbb commit c91c647

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_lexer/src/unescape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ fn scan_escape(chars: &mut Chars<'_>, mode: Mode) -> Result<char, EscapeError> {
184184

185185
let value = hi * 16 + lo;
186186

187-
// For a byte literal verify that it is within ASCII range.
187+
// For a non-byte literal verify that it is within ASCII range.
188188
if !mode.is_bytes() && !is_ascii(value) {
189189
return Err(EscapeError::OutOfRangeHexEscape);
190190
}

0 commit comments

Comments
 (0)