Skip to content

Commit

Permalink
Replace ZWJ with nothing in terminal output
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 23, 2021
1 parent 5a68abb commit a96fe02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_errors/src/emitter.rs
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/parser/emoji-identifiers.stderr
Expand Up @@ -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
Expand Down

0 comments on commit a96fe02

Please sign in to comment.