rust/compiler/rustc_errors/src
bors 42b2496320 Auto merge of #126597 - estebank:unicode-output, r=fmease
Add Unicode block-drawing compiler output support

Add nightly-only theming support to rustc output using Unicode box
drawing characters instead of ASCII-art to draw the terminal UI.

In order to enable, the flags `-Zunstable-options=yes --error-format=human-unicode` must be passed in.

After:

```
error: foo
  ╭▸ test.rs:3:3
  │
3 │       X0 Y0 Z0
  │   ┌───╿──│──┘
  │  ┌│───│──┘
  │ ┏││━━━┙
  │ ┃││
4 │ ┃││   X1 Y1 Z1
5 │ ┃││   X2 Y2 Z2
  │ ┃│└────╿──│──┘ `Z` label
  │ ┃└─────│──┤
  │ ┗━━━━━━┥  `Y` is a good letter too
  │        `X` is a good letter
  ╰╴
note: bar
  ╭▸ test.rs:4:3
  │
4 │ ┏   X1 Y1 Z1
5 │ ┃   X2 Y2 Z2
6 │ ┃   X3 Y3 Z3
  │ ┗━━━━━━━━━━┛
  ├ note: bar
  ╰ note: baz
note: qux
  ╭▸ test.rs:4:3
  │
4 │   X1 Y1 Z1
  ╰╴  ━━━━━━━━
```

Before:

```
error: foo
 --> test.rs:3:3
  |
3 |       X0 Y0 Z0
  |    ___^__-__-
  |   |___|__|
  |  ||___|
  | |||
4 | |||   X1 Y1 Z1
5 | |||   X2 Y2 Z2
  | |||____^__-__- `Z` label
  | ||_____|__|
  | |______|  `Y` is a good letter too
  |        `X` is a good letter
  |
note: bar
 --> test.rs:4:3
  |
4 | /   X1 Y1 Z1
5 | |   X2 Y2 Z2
6 | |   X3 Y3 Z3
  | |__________^
  = note: bar
  = note: baz
note: qux
 --> test.rs:4:3
  |
4 |   X1 Y1 Z1
  |   ^^^^^^^^
```

After:

![rustc output with unicode box drawing characters](d210b79a-6579-4407-9706-ba8edc6e9f25)

Before:
![current rustc output with ASCII art](5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-11 00:00:58 +00:00
..
json Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
markdown chore: Fix typos in 'compiler' (batch 1) 2024-09-02 07:42:38 +02:00
annotate_snippet_emitter_writer.rs fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
codes.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
diagnostic.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
diagnostic_impls.rs Rename target triple to target tuple in many places in the compiler 2024-11-02 21:29:59 +01:00
emitter.rs Auto merge of #126597 - estebank:unicode-output, r=fmease 2024-11-11 00:00:58 +00:00
error.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
json.rs Auto merge of #126597 - estebank:unicode-output, r=fmease 2024-11-11 00:00:58 +00:00
lib.rs Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errors 2024-10-07 12:23:54 +02:00
lock.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
registry.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
snippet.rs Add warn(unreachable_pub) to rustc_errors. 2024-08-27 12:03:37 +10:00
styled_buffer.rs Add warn(unreachable_pub) to rustc_errors. 2024-08-27 12:03:37 +10:00
tests.rs Convert Option<&Lrc<T>> return types to Option<&T>. 2024-10-07 13:56:29 +11:00
translation.rs Convert Option<&Lrc<T>> return types to Option<&T>. 2024-10-07 13:56:29 +11:00