diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-09-27 15:25:34 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-09-27 15:25:34 +1000 |
| commit | c91c64708b1acf3c262a2a6d6551f4bc0acfa656 (patch) | |
| tree | 36de21d7a306dc743745c0319b7a4f0ed78de76c | |
| parent | f3fafbb006ee98635874f73e480655912b465e65 (diff) | |
| download | rust-c91c64708b1acf3c262a2a6d6551f4bc0acfa656.tar.gz rust-c91c64708b1acf3c262a2a6d6551f4bc0acfa656.zip | |
Fix an incorrect comment.
If a `\x` escape occurs in a non-byte literals (e.g. char literal, string literal), it must be <= 0xff.
| -rw-r--r-- | compiler/rustc_lexer/src/unescape.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lexer/src/unescape.rs b/compiler/rustc_lexer/src/unescape.rs index 3da6bc14622..25d5f2772de 100644 --- a/compiler/rustc_lexer/src/unescape.rs +++ b/compiler/rustc_lexer/src/unescape.rs @@ -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); } |
