about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-12-13 16:03:54 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-14 15:53:55 +1100
commite3b7ecc1efc7170fe418e99e071598e7e14aebe1 (patch)
tree2ae8c094c0632fc37b6ccf03f8217daa189e9d41 /compiler/rustc_parse/src
parent7bdb227567398bed342697ea1f76f2cb34c9a7c2 (diff)
downloadrust-e3b7ecc1efc7170fe418e99e071598e7e14aebe1.tar.gz
rust-e3b7ecc1efc7170fe418e99e071598e7e14aebe1.zip
Remove one use of `span_bug_no_panic`.
It's unclear why this is used here. All entries in the third column of
`UNICODE_ARRAY` are covered by `ASCII_ARRAY`, so if the lookup fails
it's a genuine compiler bug. It was added way back in #29837, for no
clear reason.

This commit changes it to `span_bug`, which is more typical.
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/lexer/unicode_chars.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/lexer/unicode_chars.rs b/compiler/rustc_parse/src/lexer/unicode_chars.rs
index bbfb160ebf7..0dc60688955 100644
--- a/compiler/rustc_parse/src/lexer/unicode_chars.rs
+++ b/compiler/rustc_parse/src/lexer/unicode_chars.rs
@@ -350,8 +350,7 @@ pub(super) fn check_for_substitution(
 
     let Some((_, ascii_name, token)) = ASCII_ARRAY.iter().find(|&&(s, _, _)| s == ascii_str) else {
         let msg = format!("substitution character not found for '{ch}'");
-        reader.sess.span_diagnostic.span_bug_no_panic(span, msg);
-        return (None, None);
+        reader.sess.span_diagnostic.span_bug(span, msg);
     };
 
     // special help suggestion for "directed" double quotes