Skip to content

Commit e3b7ecc

Browse files
committed
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 rust-lang#29837, for no clear reason. This commit changes it to `span_bug`, which is more typical.
1 parent 7bdb227 commit e3b7ecc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_parse/src/lexer/unicode_chars.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ pub(super) fn check_for_substitution(
350350

351351
let Some((_, ascii_name, token)) = ASCII_ARRAY.iter().find(|&&(s, _, _)| s == ascii_str) else {
352352
let msg = format!("substitution character not found for '{ch}'");
353-
reader.sess.span_diagnostic.span_bug_no_panic(span, msg);
354-
return (None, None);
353+
reader.sess.span_diagnostic.span_bug(span, msg);
355354
};
356355

357356
// special help suggestion for "directed" double quotes

0 commit comments

Comments
 (0)