Skip to content

Commit 667400d

Browse files
committed
Add more tests for unicode output
1 parent 30347d8 commit 667400d

20 files changed

+145
-279
lines changed

tests/ui/diagnostic-width/E0271.ascii.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0271]: type mismatch resolving `<Result<Result<(), Result<Result<(), Result<Result<(), Option<{integer}>>, ...>>, ...>>, ...> as Future>::Error == Foo`
2-
--> $DIR/E0271.rs:18:5
2+
--> $DIR/E0271.rs:20:5
33
|
44
LL | / Box::new(
55
LL | | Ok::<_, ()>(
@@ -11,7 +11,7 @@ LL | | )
1111
| |_____^ type mismatch resolving `<Result<Result<(), Result<Result<(), ...>, ...>>, ...> as Future>::Error == Foo`
1212
|
1313
note: expected this to be `Foo`
14-
--> $DIR/E0271.rs:8:18
14+
--> $DIR/E0271.rs:10:18
1515
|
1616
LL | type Error = E;
1717
| ^

tests/ui/diagnostic-width/E0271.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//@ compile-flags: --diagnostic-width=40
1+
//@ revisions: ascii unicode
2+
//@[ascii] compile-flags: --diagnostic-width=40
3+
//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode --diagnostic-width=40
24
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
35
trait Future {
46
type Error;
@@ -15,7 +17,7 @@ impl<T> Future for Option<T> {
1517
struct Foo;
1618

1719
fn foo() -> Box<dyn Future<Error=Foo>> {
18-
Box::new( //~ ERROR E0271
20+
Box::new( //[ascii]~ ERROR E0271
1921
Ok::<_, ()>(
2022
Err::<(), _>(
2123
Ok::<_, ()>(

tests/ui/diagnostic-width/E0271.stderr

-22
This file was deleted.

tests/ui/diagnostic-width/E0271.unicode.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error[E0271]: type mismatch resolving `<Result<Result<(), Result<Result<(), Result<Result<(), Option<{integer}>>, ...>>, ...>>, ...> as Future>::Error == Foo`
2-
--> $DIR/E0271.rs:18:5
3-
|
4-
LL | / Box::new(
5-
LL | | Ok::<_, ()>(
6-
LL | | Err::<(), _>(
7-
LL | | Ok::<_, ()>(
8-
... |
9-
LL | | )
10-
LL | | )
11-
| |_____^ type mismatch resolving `<Result<Result<(), Result<Result<(), ...>, ...>>, ...> as Future>::Error == Foo`
12-
|
2+
╭▸ $DIR/E0271.rs:20:5
3+
4+
LL │ ┏ Box::new(
5+
LL │ ┃ Ok::<_, ()>(
6+
LL │ ┃ Err::<(), _>(
7+
LL │ ┃ Ok::<_, ()>(
8+
‡ ┃
9+
LL │ ┃ )
10+
LL │ ┃ )
11+
│ ┗━━━━━┛ type mismatch resolving `<Result<Result<(), Result<Result<(), ...>, ...>>, ...> as Future>::Error == Foo`
12+
╰╴
1313
note: expected this to be `Foo`
14-
--> $DIR/E0271.rs:8:18
15-
|
16-
LL | type Error = E;
17-
| ^
18-
= note: required for the cast from `Box<Result<Result<(), Result<Result<(), Result<Result<(), Option<{integer}>>, ()>>, ()>>, ()>>` to `Box<(dyn Future<Error = Foo> + 'static)>`
14+
╭▸ $DIR/E0271.rs:10:18
15+
16+
LL type Error = E;
17+
18+
note: required for the cast from `Box<Result<Result<(), Result<Result<(), Result<Result<(), Option<{integer}>>, ()>>, ()>>, ()>>` to `Box<(dyn Future<Error = Foo> + 'static)>`
1919

2020
error: aborting due to 1 previous error
2121

tests/ui/diagnostic-width/flag-human.ascii.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/flag-human.rs:7:17
2+
--> $DIR/flag-human.rs:9:17
33
|
44
LL | ..._: () = 42;
55
| -- ^^ expected `()`, found integer
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
//@ compile-flags: --diagnostic-width=20
1+
//@ revisions: ascii unicode
2+
//@[ascii] compile-flags: --diagnostic-width=20
3+
//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode --diagnostic-width=20
24

35
// This test checks that `-Z output-width` effects the human error output by restricting it to an
46
// arbitrarily low value so that the effect is visible.
57

68
fn main() {
79
let _: () = 42;
8-
//~^ ERROR mismatched types
10+
//[ascii]~^ ERROR mismatched types
911
}

tests/ui/diagnostic-width/flag-human.stderr

-11
This file was deleted.

tests/ui/diagnostic-width/flag-human.unicode.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0308]: mismatched types
2-
--> $DIR/flag-human.rs:7:17
3-
|
4-
LL | ..._: () = 42;
5-
| -- ^^ expected `()`, found integer
6-
| |
7-
| expected due to this
2+
╭▸ $DIR/flag-human.rs:9:17
3+
4+
LL │ …t _: () = 42;
5+
┬─ ━━ expected `()`, found integer
6+
7+
╰╴ expected due to this
88

99
error: aborting due to 1 previous error
1010

tests/ui/diagnostic-width/long-E0308.ascii.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/long-E0308.rs:44:9
2+
--> $DIR/long-E0308.rs:46:9
33
|
44
LL | let x: Atype<
55
| _____________-
@@ -19,12 +19,12 @@ LL | | ))))))))))))))))))))))))))))));
1919
| |__________________________________^ expected `Atype<Btype<..., ...>, ...>`, found `Result<Result<..., ...>, ...>`
2020
|
2121
= note: expected struct `Atype<Btype<..., ...>, ...>`
22-
found enum `Result<Result<..., ...>, ...>`
22+
| found enum `Result<Result<..., ...>, ...>`
2323
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308.ascii/long-E0308.long-type-hash.txt'
2424
= note: consider using `--verbose` to print the full type name to the console
2525

2626
error[E0308]: mismatched types
27-
--> $DIR/long-E0308.rs:57:26
27+
--> $DIR/long-E0308.rs:59:26
2828
|
2929
LL | ))))))))))))))))) == Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
3030
| __________________________^
@@ -35,12 +35,12 @@ LL | | ))))))))))))))))))))))));
3535
| |____________________________^ expected `Option<Result<..., ...>>`, found `Result<Result<..., ...>, ...>`
3636
|
3737
= note: expected enum `Option<Result<..., ...>>`
38-
found enum `Result<Result<..., ...>, ...>`
38+
| found enum `Result<Result<..., ...>, ...>`
3939
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308.ascii/long-E0308.long-type-hash.txt'
4040
= note: consider using `--verbose` to print the full type name to the console
4141

4242
error[E0308]: mismatched types
43-
--> $DIR/long-E0308.rs:88:9
43+
--> $DIR/long-E0308.rs:90:9
4444
|
4545
LL | let x: Atype<
4646
| ____________-
@@ -55,12 +55,12 @@ LL | | > = ();
5555
| expected due to this
5656
|
5757
= note: expected struct `Atype<Btype<..., ...>, ...>`
58-
found unit type `()`
58+
| found unit type `()`
5959
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308.ascii/long-E0308.long-type-hash.txt'
6060
= note: consider using `--verbose` to print the full type name to the console
6161

6262
error[E0308]: mismatched types
63-
--> $DIR/long-E0308.rs:91:17
63+
--> $DIR/long-E0308.rs:93:17
6464
|
6565
LL | let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
6666
| ____________--___^
@@ -73,7 +73,7 @@ LL | | ))))))))))))))))))))))));
7373
| |____________________________^ expected `()`, found `Result<Result<..., ...>, ...>`
7474
|
7575
= note: expected unit type `()`
76-
found enum `Result<Result<..., ...>, ...>`
76+
| found enum `Result<Result<..., ...>, ...>`
7777
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308.ascii/long-E0308.long-type-hash.txt'
7878
= note: consider using `--verbose` to print the full type name to the console
7979

tests/ui/diagnostic-width/long-E0308.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
1+
//@ revisions: ascii unicode
2+
//@[ascii] compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
3+
//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
24
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
35

46
mod a {
@@ -46,7 +48,7 @@ fn main() {
4648
Ok("")
4749
))))))))))))))))))))))))))))))
4850
))))))))))))))))))))))))))))));
49-
//~^^^^^ ERROR E0308
51+
//[ascii]~^^^^^ ERROR E0308
5052

5153
let _ = Some(Ok(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(
5254
Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(
@@ -59,7 +61,7 @@ fn main() {
5961
Ok(Ok(Ok(Ok(Ok(Ok(Ok("")))))))
6062
))))))))))))))))))))))))))))))
6163
))))))))))))))))))))))));
62-
//~^^^^^ ERROR E0308
64+
//[ascii]~^^^^^ ERROR E0308
6365

6466
let x: Atype<
6567
Btype<
@@ -86,12 +88,12 @@ fn main() {
8688
>,
8789
i32
8890
> = ();
89-
//~^ ERROR E0308
91+
//[ascii]~^ ERROR E0308
9092

9193
let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
9294
Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
9395
Ok(Ok(Ok(Ok(Ok(Ok(Ok("")))))))
9496
))))))))))))))))))))))))))))))
9597
))))))))))))))))))))))));
96-
//~^^^^^ ERROR E0308
98+
//[ascii]~^^^^^ ERROR E0308
9799
}

tests/ui/diagnostic-width/long-E0308.stderr

-82
This file was deleted.

0 commit comments

Comments
 (0)