rust/tests/rustdoc-ui
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](https://github.com/rust-lang/rust/assets/1606434/d210b79a-6579-4407-9706-ba8edc6e9f25)

Before:
![current rustc output with ASCII art](https://github.com/rust-lang/rust/assets/1606434/5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-11 00:00:58 +00:00
..
argfile compiletest: add enable-by-default check-cfg 2024-05-04 11:30:38 +02:00
auxiliary Rollup merge of #123574 - notriddle:notriddle/issue-d, r=fmease 2024-04-16 15:19:12 +02:00
coverage [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
doctest Rollup merge of #132210 - notriddle:notriddle/doctest-span-hack, r=GuillaumeGomez 2024-10-30 14:01:37 -07:00
error-in-impl-trait [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
generate-link-to-definition Update rustdoc-ui test for --generate-link-to-definition option 2024-08-13 15:08:07 +02:00
intra-doc Improve documentation for intra-doc links computation 2024-10-15 15:42:53 +02:00
issues rustdoc: rewrite stability inheritance as a pass 2024-09-30 21:58:18 +00:00
lints Improve mistyped docblock attribute warning messages 2024-09-28 18:38:11 +02:00
scrape-examples [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
suggestions [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
synthetic-auto-trait-impls Rollup merge of #123375 - fmease:rustdoc-sati-re-hotfix, r=GuillaumeGomez 2024-04-02 21:22:04 +02:00
2024-doctests-checks.rs Fix commands syntax in rustdoc-ui tests 2024-08-13 20:14:57 +02:00
2024-doctests-checks.stdout Only keep "useful" code in tests/rustdoc-ui/2024-doctests-checks.rs 2024-08-13 20:14:57 +02:00
2024-doctests-crate-attribute.rs Fix commands syntax in rustdoc-ui tests 2024-08-13 20:14:57 +02:00
2024-doctests-crate-attribute.stdout Add doctest to ensure that doctests with crate-level attributes are not part of merged doctest 2024-08-13 20:14:57 +02:00
ambiguous-inherent-assoc-ty.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
apit-46976.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
associated-constant-not-allowed-102467.rs rustdoc: rename issue-\d+.rs tests to have meaningful names 2024-09-12 13:47:51 -07:00
associated-constant-not-allowed-102467.stderr rustdoc: re-bless stderrs after renaming the test case 2024-09-12 13:48:51 -07:00
bounded-hr-lifetime.rs Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
bounded-hr-lifetime.stderr Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
cfg-boolean-literal.rs Adjust rustdoc for literal boolean support 2024-10-04 09:09:20 +02:00
check-cfg.rs Stabilize checking of cfgs at compile-time: --check-cfg option 2024-04-15 21:49:55 +02:00
check-cfg.stderr Move --check-cfg documentation to stable books 2024-04-15 21:49:56 +02:00
check-doc-alias-attr-location.rs
check-doc-alias-attr-location.stderr
check-doc-alias-attr.rs
check-doc-alias-attr.stderr
circular-intra-doc-link-48414.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
const_arg_in_type_position.rs rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
const_arg_in_type_position.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
const-evalutation-ice.rs
const-evalutation-ice.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
crate-reference-in-block-module.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
crate-reference-in-block-module.stderr rustdoc: Don't crash on crate references in blocks 2023-03-10 17:49:13 +01:00
custom_code_classes_in_docs-warning3.rs Stabilize custom_code_classes_in_docs feature 2024-05-01 16:45:27 +02:00
custom_code_classes_in_docs-warning3.stderr Stabilize custom_code_classes_in_docs feature 2024-05-01 16:45:27 +02:00
deprecated-attrs.rs Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES 2024-10-15 13:28:39 +02:00
deprecated-attrs.stderr Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES 2024-10-15 13:28:39 +02:00
deref-generic.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
diagnostic-width.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
diagnostic-width.stderr Adjust rustdoc automatic link suggestion 2024-07-04 00:40:04 +00:00
disambiguator-endswith-named-suffix.rs add test for #126986 2024-06-28 08:01:07 +08:00
disambiguator-endswith-named-suffix.stderr add test for #126986 2024-06-28 08:01:07 +08:00
disambiguator-macro-endswith-exclamatory.rs add test for #126986 2024-06-28 08:01:07 +08:00
disambiguator-macro-endswith-exclamatory.stderr add test for #126986 2024-06-28 08:01:07 +08:00
doc-alias-assoc-const.rs
doc-alias-assoc-const.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
doc-alias-crate-level.rs
doc-alias-crate-level.stderr
doc-alias-same-name.rs
doc-alias-same-name.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
doc-cfg.rs
doc-cfg.stderr
doc-include-suggestion.rs Update ui tests 2024-02-29 14:43:43 +01:00
doc-include-suggestion.stderr Update ui tests 2024-02-29 14:43:43 +01:00
feature-gate-doc_cfg_hide.rs
feature-gate-doc_cfg_hide.stderr Bless tests 2024-01-13 12:46:58 -05:00
hidden-trait-method-34423.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
ice-assoc-const-for-primitive-31808.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
ice-assoc-type-loop-102154.rs Move assertion-free rustdoc ice tests to rustdoc-ui 2024-07-12 18:18:30 -07:00
ice-blanket-impl-52873.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
ice-blanket-impl-56701.rs Move ice tests to rustdoc-ui 2024-04-15 15:11:49 -07:00
ice-blanket-impl-119792.rs Add a regression test for a former blanket impl synthesis ICE 2024-06-03 03:50:15 +02:00
ice-blanket-impl-selection-55001.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
ice-bug-report-url.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
ice-bug-report-url.stderr tests: bless ui and rustdoc-ui tests for ICE messages 2024-04-09 13:58:52 +00:00
ice-cross-crate-opaque-assoc-type-73061.rs Move ice tests to rustdoc-ui 2024-04-15 15:11:49 -07:00
ice-method-where-clause-circular-100620.rs Move assertion-free rustdoc ice tests to rustdoc-ui 2024-07-12 18:18:30 -07:00
ice-unresolved-import-100241.rs Move assertion-free rustdoc ice tests to rustdoc-ui 2024-07-12 18:18:30 -07:00
ice-unresolved-import-100241.stderr Structured suggestion for extern crate foo when foo isn't resolved in import 2024-07-29 23:49:51 +00:00
ignore-block-help.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
ignore-block-help.stderr
impl-fn-nesting.rs
impl-fn-nesting.stderr Make configure_and_expand "infalllible" by just aborting the compilation if it fails instead of bubbling out an error 2023-02-20 15:28:59 +00:00
include-str-bare-urls.rs rustdoc: point at span in include_str!-ed md file 2024-03-29 13:31:35 -07:00
include-str-bare-urls.stderr Adjust rustdoc automatic link suggestion 2024-07-04 00:40:04 +00:00
infinite-recursive-type.rs
infinite-recursive-type.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
inherent-assoc-consts-36031.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
invalid_associated_const.rs Rename HIR TypeBinding to AssocItemConstraint and related cleanup 2024-05-30 22:52:33 +02:00
invalid_associated_const.stderr Fix associated item removal suggestion 2024-07-17 21:30:40 +00:00
invalid_const_in_lifetime_position.rs Accept less invalid Rust in rustdoc 2023-10-31 13:58:03 +00:00
invalid_const_in_lifetime_position.stderr Compiler: Rename "object safe" to "dyn compatible" 2024-09-25 13:26:48 +02:00
invalid_infered_static_and_const.rs rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid_infered_static_and_const.stderr rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid-cfg.rs
invalid-cfg.stderr
invalid-keyword.rs
invalid-keyword.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
invalid-redundant-explicit-link.rs Add regression test for #123158 2024-03-28 11:09:08 +01:00
invalid-syntax.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
invalid-syntax.stderr Add Unicode block-drawing compiler output support 2024-11-10 23:57:18 +01:00
invalid-theme-name.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
invalid-theme-name.stderr
macro-docs.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
macro-docs.stderr
macro-docs.stdout
mismatched_arg_count.rs rustdoc: remove excess from rustdoc test 2023-03-30 14:55:03 +02:00
mismatched_arg_count.stderr Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
nested-extern-crate-46271.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nested-macro-rules-47639.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
normalize-cycle.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
normalize-in-inlined-type-alias.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
normalize-overflow.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
not-wf-ambiguous-normalization.rs Merge check_mod_impl_wf and check_mod_type_wf 2024-03-07 06:27:09 +00:00
not-wf-ambiguous-normalization.stderr Merge check_mod_impl_wf and check_mod_type_wf 2024-03-07 06:27:09 +00:00
output-format-html-stable.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
private-type-cycle-110629.rs rustdoc: rename issue-\d+.rs tests to have meaningful names 2024-09-12 13:47:51 -07:00
private-type-cycle-dyn-110629.rs rustdoc: rename issue-\d+.rs tests to have meaningful names 2024-09-12 13:47:51 -07:00
private-type-cycle-dyn-110629.stderr rustdoc: re-bless stderrs after renaming the test case 2024-09-12 13:48:51 -07:00
proc_macro_bug.rs Test rustdoc encountering proc_macro_derive in a non-proc-macro crate 2023-02-23 09:00:33 +00:00
proc_macro_bug.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
projection-as-union-type-error.rs rustdoc: add two regression tests 2024-09-09 22:35:10 +02:00
projection-as-union-type-error.stderr rustdoc: add two regression tests 2024-09-09 22:35:10 +02:00
pub-use-primitive-document-private-items-95633.rs Move tests into appropriate subdirectories 2024-05-21 21:21:26 -07:00
range-pattern.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
recursive-deref-ice.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
recursive-type-alias-impl-trait-declaration-too-subtle-2.rs rustdoc: add two regression tests 2024-09-09 22:35:10 +02:00
redundant-explicit-links-123677.rs rustdoc: check redundant explicit links with correct itemid 2024-04-13 19:32:39 -07:00
remap-path-prefix-failed-doctest-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
remap-path-prefix-failed-doctest-output.stdout rustdoc: Add support for --remap-path-prefix 2024-06-09 10:34:54 -07:00
remap-path-prefix-invalid-doctest.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
remap-path-prefix-invalid-doctest.stdout rustdoc: Add support for --remap-path-prefix 2024-06-09 10:34:54 -07:00
remap-path-prefix-lint.rs Add regression test for #69264 2024-08-06 16:56:48 +02:00
remap-path-prefix-lint.stderr Add regression test for #69264 2024-08-06 16:56:48 +02:00
remap-path-prefix-passed-doctest-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
remap-path-prefix-passed-doctest-output.stdout rustdoc: Add support for --remap-path-prefix 2024-06-09 10:34:54 -07:00
rustc-check-passes.rs
rustc-check-passes.stderr terminology: #[feature] *enables* a feature (instead of "declaring" or "activating" it) 2024-10-22 07:37:54 +01:00
search-index-generics-recursion-bug-issue-59502.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
show-coverage-json.rs Add UI regressions tests for rustdoc --show-coverage option 2024-11-04 14:46:04 +01:00
show-coverage-json.stdout Add UI regressions tests for rustdoc --show-coverage option 2024-11-04 14:46:04 +01:00
show-coverage.rs Add UI regressions tests for rustdoc --show-coverage option 2024-11-04 14:46:04 +01:00
show-coverage.stdout Add UI regressions tests for rustdoc --show-coverage option 2024-11-04 14:46:04 +01:00
super-glob-40936.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
track-diagnostics.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
track-diagnostics.stderr Move all error reporting into rustc_trait_selection 2024-07-21 22:34:35 -04:00
tuple-variadic-check.rs
tuple-variadic-check.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
unable-fulfill-trait.rs Avoid follow-up errors and ICEs after missing lifetime errors on data structures 2024-07-11 11:00:15 +00:00
unable-fulfill-trait.stderr Avoid follow-up errors and ICEs after missing lifetime errors on data structures 2024-07-11 11:00:15 +00:00
unescaped_backticks.rs Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug. 2023-12-02 09:01:19 +11:00
unescaped_backticks.stderr rustdoc: point at span in include_str!-ed md file 2024-03-29 13:31:35 -07:00
unportable-markdown.rs Adjust expected errors for a rustdoc test 2024-08-18 22:52:54 -05:00
unportable-markdown.stderr Adjust expected errors for a rustdoc test 2024-08-18 22:52:54 -05:00
unused-extern-crate.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
use_both_out_dir_and_output_options.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
use_both_out_dir_and_output_options.stderr
wasm-safe.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00