Skip to content

Commit a96fe02

Browse files
committed
Replace ZWJ with nothing in terminal output
1 parent 5a68abb commit a96fe02

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/rustc_errors/src/emitter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,7 @@ fn num_decimal_digits(num: usize) -> usize {
20812081
// We replace some characters so the CLI output is always consistent and underlines aligned.
20822082
const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[
20832083
('\t', " "), // We do our own tab replacement
2084+
('\u{200D}', ""), // Replace ZWJ with nothing for consistent terminal output of grapheme clusters.
20842085
('\u{202A}', ""), // The following unicode text flow control characters are inconsistently
20852086
('\u{202B}', ""), // supported accross CLIs and can cause confusion due to the bytes on disk
20862087
('\u{202D}', ""), // not corresponding to the visible source code, so we replace them always.

src/test/ui/parser/emoji-identifiers.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ error: identifiers cannot contain emojis: `i_like_to_😅_a_lot`
4848
LL | fn i_like_to_😅_a_lot() -> 👀 {
4949
| ^^^^^^^^^^^^^^^^^^
5050

51-
error: identifiers cannot contain emojis: `ABig👩‍👩‍👧‍👧Family`
51+
error: identifiers cannot contain emojis: `ABig👩👩👧👧Family`
5252
--> $DIR/emoji-identifiers.rs:1:8
5353
|
54-
LL | struct ABig👩‍👩‍👧‍👧Family;
54+
LL | struct ABig👩👩👧👧Family;
5555
| ^^^^^^^^^^^^^^^^^^
5656

5757
error[E0599]: no function or associated item named `full_of✨` found for struct `👀` in the current scope

0 commit comments

Comments
 (0)