Skip to content

Commit

Permalink
Remove one use of span_bug_no_panic.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nnethercote committed Dec 13, 2023
1 parent f564042 commit da8dd4a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_parse/src/lexer/unicode_chars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit da8dd4a

Please sign in to comment.