diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-13 09:29:59 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-13 10:06:13 +1100 |
| commit | 29c5158ef5772351475d650ffbee417b36885766 (patch) | |
| tree | 0706ac6fd94987ee630fcc5670f9547323c4661a /compiler | |
| parent | 423bf4233d92dfaa4c97f04c4fc3a2368d880d24 (diff) | |
| download | rust-29c5158ef5772351475d650ffbee417b36885766.tar.gz rust-29c5158ef5772351475d650ffbee417b36885766.zip | |
Adjust `Mode::is_unicode_escape_disallowed`.
Some cases are unreachable.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lexer/src/unescape.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_lexer/src/unescape.rs b/compiler/rustc_lexer/src/unescape.rs index 249126a269e..f6216504e98 100644 --- a/compiler/rustc_lexer/src/unescape.rs +++ b/compiler/rustc_lexer/src/unescape.rs @@ -191,8 +191,9 @@ impl Mode { /// Byte literals do not allow unicode escape. fn is_unicode_escape_disallowed(self) -> bool { match self { - Byte | ByteStr | RawByteStr => true, - Char | Str | RawStr | CStr | RawCStr => false, + Byte | ByteStr => true, + Char | Str | CStr => false, + RawByteStr | RawStr | RawCStr => unreachable!(), } } |
