about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-12-13 09:29:59 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-13 10:06:13 +1100
commit29c5158ef5772351475d650ffbee417b36885766 (patch)
tree0706ac6fd94987ee630fcc5670f9547323c4661a /compiler
parent423bf4233d92dfaa4c97f04c4fc3a2368d880d24 (diff)
downloadrust-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.rs5
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!(),
         }
     }