about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2021-09-09 15:01:43 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2021-11-23 20:36:14 +0000
commita96fe02f6c5da9b903a658186255c5420537b9f8 (patch)
tree71273b8d95b7500420a4c298e088e7ba28629686
parent5a68abb0943e687cc6c8165376b4ed6deda17db3 (diff)
downloadrust-a96fe02f6c5da9b903a658186255c5420537b9f8.tar.gz
rust-a96fe02f6c5da9b903a658186255c5420537b9f8.zip
Replace ZWJ with nothing in terminal output
-rw-r--r--compiler/rustc_errors/src/emitter.rs1
-rw-r--r--src/test/ui/parser/emoji-identifiers.stderr4
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 6b79962ddd6..d44a216f234 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -2081,6 +2081,7 @@ fn num_decimal_digits(num: usize) -> usize {
 // We replace some characters so the CLI output is always consistent and underlines aligned.
 const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[
     ('\t', "    "),   // We do our own tab replacement
+    ('\u{200D}', ""), // Replace ZWJ with nothing for consistent terminal output of grapheme clusters.
     ('\u{202A}', ""), // The following unicode text flow control characters are inconsistently
     ('\u{202B}', ""), // supported accross CLIs and can cause confusion due to the bytes on disk
     ('\u{202D}', ""), // not corresponding to the visible source code, so we replace them always.
diff --git a/src/test/ui/parser/emoji-identifiers.stderr b/src/test/ui/parser/emoji-identifiers.stderr
index 3b17bb01de9..84c3e3962ff 100644
--- a/src/test/ui/parser/emoji-identifiers.stderr
+++ b/src/test/ui/parser/emoji-identifiers.stderr
@@ -48,10 +48,10 @@ error: identifiers cannot contain emojis: `i_like_to_😅_a_lot`
 LL | fn i_like_to_😅_a_lot() -> 👀 {
    |    ^^^^^^^^^^^^^^^^^^
 
-error: identifiers cannot contain emojis: `ABig👩‍👩‍👧‍👧Family`
+error: identifiers cannot contain emojis: `ABig👩👩👧👧Family`
   --> $DIR/emoji-identifiers.rs:1:8
    |
-LL | struct ABig👩‍👩‍👧‍👧Family;
+LL | struct ABig👩👩👧👧Family;
    |        ^^^^^^^^^^^^^^^^^^
 
 error[E0599]: no function or associated item named `full_of✨` found for struct `👀` in the current scope