1d78004575
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 | ^^^^^^^^ ```
36 lines
791 B
Rust
36 lines
791 B
Rust
//@ revisions: ascii unicode
|
|
//@[ascii] compile-flags: --diagnostic-width=40
|
|
//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode --diagnostic-width=40
|
|
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
|
|
trait Future {
|
|
type Error;
|
|
}
|
|
|
|
impl<T, E> Future for Result<T, E> {
|
|
type Error = E;
|
|
}
|
|
|
|
impl<T> Future for Option<T> {
|
|
type Error = ();
|
|
}
|
|
|
|
struct Foo;
|
|
|
|
fn foo() -> Box<dyn Future<Error=Foo>> {
|
|
Box::new( //[ascii]~ ERROR E0271
|
|
Ok::<_, ()>(
|
|
Err::<(), _>(
|
|
Ok::<_, ()>(
|
|
Err::<(), _>(
|
|
Ok::<_, ()>(
|
|
Err::<(), _>(Some(5))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
}
|
|
fn main() {
|
|
}
|