Skip to content

Commit 51b5bb1

Browse files
committed
Enforce sort order
1 parent 3945480 commit 51b5bb1

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

compiler/rustc_errors/src/emitter.rs

+33-31
Original file line numberDiff line numberDiff line change
@@ -2561,41 +2561,42 @@ fn num_decimal_digits(num: usize) -> usize {
25612561
// Keep the following list in sync with `rustc_span::char_width`.
25622562
// ATTENTION: keep lexicografically sorted so that the binary search will work
25632563
const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[
2564+
// tidy-alphabetical-start
25642565
// In terminals without Unicode support the following will be garbled, but in *all* terminals
25652566
// the underlying codepoint will be as well. We could gate this replacement behind a "unicode
25662567
// support" gate.
25672568
('\0', "␀"),
2568-
('\u{1}', "␁"),
2569-
('\u{2}', "␂"),
2570-
('\u{3}', "␃"),
2571-
('\u{4}', "␄"),
2572-
('\u{5}', "␅"),
2573-
('\u{6}', "␆"),
2574-
('\u{7}', "␇"),
2575-
('\u{8}', "␈"),
2576-
('\t', " "), // We do our own tab replacement
2577-
('\u{b}', "␋"),
2578-
('\u{c}', "␌"),
2579-
('\r', "␍"),
2580-
('\u{e}', "␎"),
2581-
('\u{f}', "␏"),
2582-
('\u{10}', "␐"),
2583-
('\u{11}', "␑"),
2584-
('\u{12}', "␒"),
2585-
('\u{13}', "␓"),
2586-
('\u{14}', "␔"),
2587-
('\u{15}', "␕"),
2588-
('\u{16}', "␖"),
2589-
('\u{17}', "␗"),
2590-
('\u{18}', "␘"),
2591-
('\u{19}', "␙"),
2592-
('\u{1a}', "␚"),
2593-
('\u{1b}', "␛"),
2594-
('\u{1c}', "␜"),
2595-
('\u{1d}', "␝"),
2596-
('\u{1e}', "␞"),
2597-
('\u{1f}', "␟"),
2598-
('\u{7f}', "␡"),
2569+
('\u{0001}', "␁"),
2570+
('\u{0002}', "␂"),
2571+
('\u{0003}', "␃"),
2572+
('\u{0004}', "␄"),
2573+
('\u{0005}', "␅"),
2574+
('\u{0006}', "␆"),
2575+
('\u{0007}', "␇"),
2576+
('\u{0008}', "␈"),
2577+
('\u{0009}', " "), // We do our own tab replacement
2578+
('\u{000b}', "␋"),
2579+
('\u{000c}', "␌"),
2580+
('\u{000d}', "␍"),
2581+
('\u{000e}', "␎"),
2582+
('\u{000f}', "␏"),
2583+
('\u{0010}', "␐"),
2584+
('\u{0011}', "␑"),
2585+
('\u{0012}', "␒"),
2586+
('\u{0013}', "␓"),
2587+
('\u{0014}', "␔"),
2588+
('\u{0015}', "␕"),
2589+
('\u{0016}', "␖"),
2590+
('\u{0017}', "␗"),
2591+
('\u{0018}', "␘"),
2592+
('\u{0019}', "␙"),
2593+
('\u{001a}', "␚"),
2594+
('\u{001b}', "␛"),
2595+
('\u{001c}', "␜"),
2596+
('\u{001d}', "␝"),
2597+
('\u{001e}', "␞"),
2598+
('\u{001f}', "␟"),
2599+
('\u{007f}', "␡"),
25992600
('\u{200d}', ""), // Replace ZWJ for consistent terminal output of grapheme clusters.
26002601
('\u{202a}', "�"), // The following unicode text flow control characters are inconsistently
26012602
('\u{202b}', "�"), // supported across CLIs and can cause confusion due to the bytes on disk
@@ -2606,6 +2607,7 @@ const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[
26062607
('\u{2067}', "�"),
26072608
('\u{2068}', "�"),
26082609
('\u{2069}', "�"),
2610+
// tidy-alphabetical-end
26092611
];
26102612

26112613
fn normalize_whitespace(s: &str) -> String {

0 commit comments

Comments
 (0)