about summary refs log tree commit diff
path: root/tests/ui/error-emitter
AgeCommit message (Collapse)AuthorLines
2025-09-19chore(compiletest): Use newest anstyle-svg versionScott Schafer-8/+8
2025-09-08pass `sub_relations` into canonical querieslcnr-206/+158
2025-07-31fix: Match width of ascii and unicode secondary file startScott Schafer-1/+1
2025-07-31fix: Only "close the window" when its the last annotated fileScott Schafer-1/+1
2025-07-30test: Check close window renderingScott Schafer-0/+43
2025-06-06reword suggestion messageEsteban Küber-1/+1
2025-06-06Make cast suggestions verboseEsteban Küber-4/+7
``` error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; | ^^^^^^^^^^^^ invalid cast | help: try `char::from_u32` instead | LL - 1u32 as char; LL + char::from_u32(1u32); | ``` ``` error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; | ^^^^^^^^^^^^^ | help: try casting to a reference instead | LL | arr as &[char]; | + ``` ``` error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; | ^^^^^^^^^^^^^^^^^^^^^^^ | help: you can cast to a `Box` instead | LL | Box::new(1) as Box<dyn Send>; | ++++ + ```
2025-05-24Avoid extra path trimming in method not found errorNoratrieb-5/+5
Method errors have an extra check that force trim paths whenever the normal string is longer than 10 characters, which can be quite unhelpful when multiple items have the same name (for example an `Error`). A user reported this force trimming as being quite unhelpful when they had a method error where the precise path of the `Error` mattered. The code uses `tcx.short_string` already to get the normal path, which tries to be clever around trimming paths if necessary, so there is no reason for this extra force trimming.
2025-05-04compiletest: Support matching on non-json lines in compiler outputVadim Petrochenkov-12/+14
and migrate most of remaining `error-pattern`s to it.
2025-04-29Move tests from /ui directorymejrs-0/+149
2025-02-02Highlight clarifying information in "expected/found" errorEsteban Küber-0/+113
When the expected and found types have the same textual representation, we add clarifying in parentheses. We now visually highlight it in the output. Detect a corner case where the clarifying information would be the same for both types and skip it, as it doesn't add anything useful.
2024-12-26Account for removal of multiline span in suggestionEsteban Küber-0/+562
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix #134485.
2024-12-16Handle fndef rendering together with signature renderingOli Scherer-3/+3
2024-11-18Don't allow `-Zunstable-options` to take a valueZalathar-1/+1
Passing an explicit boolean value (`on`, `off` etc.) appears to work, but actually puts the compiler into an unintended state where unstable _options_ are still forbidden, but unstable values of _some_ stable options are allowed.
2024-11-10Add Unicode block-drawing compiler output supportEsteban Küber-2/+95
Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI: 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 | ^^^^^^^^ ```
2024-04-27tests: remove some trailing wsklensy-20/+20
2024-04-25tests: remove few ignore-stage2klensy-14/+10
beta was branched long ago, so can be removed
2024-03-02On tests that specify --color=always emit SVG file with stderr outputEsteban Kuber-144/+389
Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-11/+11
2023-12-09use different revisions for testing colors on windowsjyn-6/+81
this is kinda jank because it means people need both machines to bless the tests
2023-12-08use magenta instead of bold for highlightingjyn-0/+111
according to a poll of gay people in my phone, purple is the most popular color to use for highlighting | color | percentage | | ---------- | ---------- | | bold white | 6% | | blue | 14% | | cyan | 26% | | purple | 37% | | magenta | 17% | unfortunately, purple is not supported by 16-color terminals, which rustc apparently wants to support for some reason. until we require support for full 256-color terms (e.g. by doing the same feature detection as we currently do for urls), we can't use it. instead, i have collapsed the purple votes into magenta on the theory that they're close, and also because magenta is pretty.