Skip to content

Commit 01b74c5

Browse files
committed
Update the UI tests to the current outputs
Thank you to whomever got the error messages using the exported names ♥
1 parent f718647 commit 01b74c5

17 files changed

+54
-61
lines changed

src/test/ui/async-await/issue-61076.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ async fn foo() -> Result<(), ()> {
3939
}
4040

4141
async fn bar() -> Result<(), ()> {
42-
foo()?; //~ ERROR the `?` operator can only be applied to values that implement `Try2021`
42+
foo()?; //~ ERROR the `?` operator can only be applied to values that implement `Try`
4343
//~^ NOTE the `?` operator cannot be applied to type `impl Future`
44-
//~| HELP the trait `Try2021` is not implemented for `impl Future`
44+
//~| HELP the trait `Try` is not implemented for `impl Future`
4545
//~| NOTE required by `branch`
4646
//~| NOTE in this expansion of desugaring of operator `?`
4747
//~| NOTE in this expansion of desugaring of operator `?`
@@ -60,9 +60,9 @@ async fn tuple() -> Tuple {
6060

6161
async fn baz() -> Result<(), ()> {
6262
let t = T;
63-
t?; //~ ERROR the `?` operator can only be applied to values that implement `Try2021`
63+
t?; //~ ERROR the `?` operator can only be applied to values that implement `Try`
6464
//~^ NOTE the `?` operator cannot be applied to type `T`
65-
//~| HELP the trait `Try2021` is not implemented for `T`
65+
//~| HELP the trait `Try` is not implemented for `T`
6666
//~| NOTE required by `branch`
6767
//~| NOTE in this expansion of desugaring of operator `?`
6868
//~| NOTE in this expansion of desugaring of operator `?`

src/test/ui/async-await/issue-61076.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
1+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
22
--> $DIR/issue-61076.rs:42:5
33
|
44
LL | foo()?;
55
| ^^^^^^ the `?` operator cannot be applied to type `impl Future`
66
|
7-
= help: the trait `Try2021` is not implemented for `impl Future`
7+
= help: the trait `Try` is not implemented for `impl Future`
88
= note: required by `branch`
99

10-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
10+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
1111
--> $DIR/issue-61076.rs:63:5
1212
|
1313
LL | t?;
1414
| ^^ the `?` operator cannot be applied to type `T`
1515
|
16-
= help: the trait `Try2021` is not implemented for `T`
16+
= help: the trait `Try` is not implemented for `T`
1717
= note: required by `branch`
1818

1919
error[E0609]: no field `0` on type `impl Future`

src/test/ui/inference/cannot-infer-closure-circular.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed for `Result<(), E>`
22
--> $DIR/cannot-infer-closure-circular.rs:7:14
33
|
44
LL | let x = |r| {
5-
| ^ consider giving this closure parameter the explicit type `Result<(), E>`, with the type parameters specified
5+
| ^ consider giving this closure parameter the explicit type `Result<(), E>`, where the type parameter `E` is specified
66

77
error: aborting due to previous error
88

src/test/ui/inference/cannot-infer-closure.stderr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
<<<<<<< HEAD
21
error[E0282]: type annotations needed for the closure `fn((), ()) -> Result<(), _>`
3-
--> $DIR/cannot-infer-closure.rs:3:15
4-
||||||| parent of f4e89f77bb1 (PoC: A new hybrid design for Try)
5-
error[E0282]: type annotations needed for the closure `fn((), ()) -> std::result::Result<(), _>`
6-
--> $DIR/cannot-infer-closure.rs:3:15
7-
=======
8-
error[E0282]: type annotations needed for the closure `fn((), ()) -> std::result::Result<(), _>`
92
--> $DIR/cannot-infer-closure.rs:4:9
10-
>>>>>>> f4e89f77bb1 (PoC: A new hybrid design for Try)
113
|
124
LL | Ok(b)
135
| ^^ cannot infer type for type parameter `E` declared on the enum `Result`

src/test/ui/issues/issue-32709.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | Err(5)?;
77
| ^^^^^^^ the trait `From<{integer}>` is not implemented for `()`
88
|
99
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
10-
= note: required because of the requirements on the impl of `FromResidual<std::result::Result<!, {integer}>>` for `std::result::Result<i32, ()>`
10+
= note: required because of the requirements on the impl of `FromResidual<Result<!, {integer}>>` for `Result<i32, ()>`
1111
= note: required by `from_residual`
1212

1313
error: aborting due to previous error

src/test/ui/option-to-result.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | a?;
88
| ^^ the trait `From<result::sadness::PleaseCallTheOkOrMethodToUseQuestionMarkOnOptionsInAMethodThatReturnsResult>` is not implemented for `()`
99
|
1010
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
11-
= note: required because of the requirements on the impl of `FromResidual<Option<!>>` for `std::result::Result<(), ()>`
11+
= note: required because of the requirements on the impl of `FromResidual<Option<!>>` for `Result<(), ()>`
1212
= note: required by `from_residual`
1313

1414
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
@@ -22,7 +22,7 @@ LL | | Some(5)
2222
LL | | }
2323
| |_- this function should return `Result` or `Option` to accept `?`
2424
|
25-
= help: the trait `FromResidual<std::result::Result<!, i32>>` is not implemented for `Option<i32>`
25+
= help: the trait `FromResidual<Result<!, i32>>` is not implemented for `Option<i32>`
2626
= note: required by `from_residual`
2727

2828
error: aborting due to 2 previous errors

src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ fn nested_within_if_expr() {
4040

4141
fn _check_try_binds_tighter() -> Result<(), ()> {
4242
if let 0 = 0? {}
43-
//~^ ERROR the `?` operator can only be applied to values that implement `Try2021`
43+
//~^ ERROR the `?` operator can only be applied to values that implement `Try`
4444
Ok(())
4545
}
4646
if (let 0 = 0)? {} //~ ERROR `let` expressions are not supported here
47-
//~^ ERROR the `?` operator can only be applied to values that implement `Try2021`
47+
//~^ ERROR the `?` operator can only be applied to values that implement `Try`
4848
//~| ERROR the `?` operator can only be used in a function that returns `Result`
4949

5050
if true || let 0 = 0 {} //~ ERROR `let` expressions are not supported here
@@ -104,11 +104,11 @@ fn nested_within_while_expr() {
104104

105105
fn _check_try_binds_tighter() -> Result<(), ()> {
106106
while let 0 = 0? {}
107-
//~^ ERROR the `?` operator can only be applied to values that implement `Try2021`
107+
//~^ ERROR the `?` operator can only be applied to values that implement `Try`
108108
Ok(())
109109
}
110110
while (let 0 = 0)? {} //~ ERROR `let` expressions are not supported here
111-
//~^ ERROR the `?` operator can only be applied to values that implement `Try2021`
111+
//~^ ERROR the `?` operator can only be applied to values that implement `Try`
112112
//~| ERROR the `?` operator can only be used in a function that returns `Result`
113113

114114
while true || let 0 = 0 {} //~ ERROR `let` expressions are not supported here
@@ -177,12 +177,12 @@ fn outside_if_and_while_expr() {
177177

178178
fn _check_try_binds_tighter() -> Result<(), ()> {
179179
let 0 = 0?;
180-
//~^ ERROR the `?` operator can only be applied to values that implement `Try2021`
180+
//~^ ERROR the `?` operator can only be applied to values that implement `Try`
181181
Ok(())
182182
}
183183
(let 0 = 0)?; //~ ERROR `let` expressions are not supported here
184184
//~^ ERROR the `?` operator can only be used in a function that returns `Result`
185-
//~| ERROR the `?` operator can only be applied to values that implement `Try2021`
185+
//~| ERROR the `?` operator can only be applied to values that implement `Try`
186186

187187
true || let 0 = 0; //~ ERROR `let` expressions are not supported here
188188
(true || let 0 = 0); //~ ERROR `let` expressions are not supported here

src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,13 @@ error[E0600]: cannot apply unary operator `-` to type `bool`
551551
LL | if -let 0 = 0 {}
552552
| ^^^^^^^^^^ cannot apply unary operator `-`
553553

554-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
554+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
555555
--> $DIR/disallowed-positions.rs:46:8
556556
|
557557
LL | if (let 0 = 0)? {}
558558
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
559559
|
560-
= help: the trait `Try2021` is not implemented for `bool`
560+
= help: the trait `Try` is not implemented for `bool`
561561
= note: required by `branch`
562562

563563
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
@@ -709,13 +709,13 @@ LL | if let Range { start: true, end } = t..&&false {}
709709
= note: expected type `bool`
710710
found struct `std::ops::Range<bool>`
711711

712-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
712+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
713713
--> $DIR/disallowed-positions.rs:42:20
714714
|
715715
LL | if let 0 = 0? {}
716716
| ^^ the `?` operator cannot be applied to type `{integer}`
717717
|
718-
= help: the trait `Try2021` is not implemented for `{integer}`
718+
= help: the trait `Try` is not implemented for `{integer}`
719719
= note: required by `branch`
720720

721721
error[E0308]: mismatched types
@@ -739,13 +739,13 @@ error[E0600]: cannot apply unary operator `-` to type `bool`
739739
LL | while -let 0 = 0 {}
740740
| ^^^^^^^^^^ cannot apply unary operator `-`
741741

742-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
742+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
743743
--> $DIR/disallowed-positions.rs:110:11
744744
|
745745
LL | while (let 0 = 0)? {}
746746
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
747747
|
748-
= help: the trait `Try2021` is not implemented for `bool`
748+
= help: the trait `Try` is not implemented for `bool`
749749
= note: required by `branch`
750750

751751
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
@@ -897,13 +897,13 @@ LL | while let Range { start: true, end } = t..&&false {}
897897
= note: expected type `bool`
898898
found struct `std::ops::Range<bool>`
899899

900-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
900+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
901901
--> $DIR/disallowed-positions.rs:106:23
902902
|
903903
LL | while let 0 = 0? {}
904904
| ^^ the `?` operator cannot be applied to type `{integer}`
905905
|
906-
= help: the trait `Try2021` is not implemented for `{integer}`
906+
= help: the trait `Try` is not implemented for `{integer}`
907907
= note: required by `branch`
908908

909909
error[E0614]: type `bool` cannot be dereferenced
@@ -918,13 +918,13 @@ error[E0600]: cannot apply unary operator `-` to type `bool`
918918
LL | -let 0 = 0;
919919
| ^^^^^^^^^^ cannot apply unary operator `-`
920920

921-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
921+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
922922
--> $DIR/disallowed-positions.rs:183:5
923923
|
924924
LL | (let 0 = 0)?;
925925
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
926926
|
927-
= help: the trait `Try2021` is not implemented for `bool`
927+
= help: the trait `Try` is not implemented for `bool`
928928
= note: required by `branch`
929929

930930
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
@@ -965,13 +965,13 @@ LL | fn outside_if_and_while_expr() {
965965
LL | &let 0 = 0
966966
| ^^^^^^^^^^ expected `()`, found `&bool`
967967

968-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
968+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
969969
--> $DIR/disallowed-positions.rs:179:17
970970
|
971971
LL | let 0 = 0?;
972972
| ^^ the `?` operator cannot be applied to type `{integer}`
973973
|
974-
= help: the trait `Try2021` is not implemented for `{integer}`
974+
= help: the trait `Try` is not implemented for `{integer}`
975975
= note: required by `branch`
976976

977977
error: aborting due to 104 previous errors; 2 warnings emitted

src/test/ui/suggestions/issue-72766.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0277]: the `?` operator can only be applied to values that implement `Try2021`
1+
error[E0277]: the `?` operator can only be applied to values that implement `Try`
22
--> $DIR/issue-72766.rs:14:5
33
|
44
LL | SadGirl {}.call()?;
55
| ^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `impl Future`
66
|
7-
= help: the trait `Try2021` is not implemented for `impl Future`
7+
= help: the trait `Try` is not implemented for `impl Future`
88
= note: required by `branch`
99

1010
error: aborting due to previous error

src/test/ui/try-block/try-block-bad-type.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
pub fn main() {
66
let res: Result<u32, std::array::TryFromSliceError> = try {
7-
Err("")?; //~ ERROR the trait bound `std::array::TryFromSliceError: From<&str>` is not satisfied
7+
Err("")?; //~ ERROR `?` couldn't convert the error to `TryFromSliceError`
88
5
99
};
1010

@@ -15,7 +15,7 @@ pub fn main() {
1515
let res: Result<i32, i32> = try { }; //~ ERROR type mismatch
1616

1717
let res: () = try { };
18-
//~^ ERROR the trait bound `(): Try2021` is not satisfied
18+
//~^ ERROR the trait bound `(): Try` is not satisfied
1919

20-
let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: Try2021` is not satisfied
20+
let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: Try` is not satisfied
2121
}

src/test/ui/try-block/try-block-bad-type.stderr

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
error[E0277]: `?` couldn't convert the error to `TryFromSliceError`
2-
--> $DIR/try-block-bad-type.rs:7:16
2+
--> $DIR/try-block-bad-type.rs:7:9
33
|
44
LL | Err("")?;
5-
| ^ the trait `From<&str>` is not implemented for `TryFromSliceError`
5+
| ^^^^^^^^ the trait `From<&str>` is not implemented for `TryFromSliceError`
66
|
77
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
88
= help: the following implementations were found:
99
<TryFromSliceError as From<Infallible>>
10-
= note: required by `from`
10+
= note: required because of the requirements on the impl of `FromResidual<Result<!, &str>>` for `Result<u32, TryFromSliceError>`
11+
= note: required by `from_residual`
1112

12-
error[E0271]: type mismatch resolving `<Result<i32, i32> as Try2021>::Ok == &str`
13+
error[E0271]: type mismatch resolving `<Result<i32, i32> as Try>::Ok == &str`
1314
--> $DIR/try-block-bad-type.rs:12:9
1415
|
1516
LL | ""
1617
| ^^ expected `i32`, found `&str`
1718

18-
error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as Try2021>::Ok == ()`
19+
error[E0271]: type mismatch resolving `<Result<i32, i32> as Try>::Ok == ()`
1920
--> $DIR/try-block-bad-type.rs:15:39
2021
|
2122
LL | let res: Result<i32, i32> = try { };
2223
| ^ expected `i32`, found `()`
2324

24-
error[E0277]: the trait bound `(): Try2021` is not satisfied
25+
error[E0277]: the trait bound `(): Try` is not satisfied
2526
--> $DIR/try-block-bad-type.rs:17:25
2627
|
2728
LL | let res: () = try { };
28-
| ^ the trait `Try2021` is not implemented for `()`
29+
| ^ the trait `Try` is not implemented for `()`
2930
|
3031
= note: required by `from_output`
3132

32-
error[E0277]: the trait bound `i32: Try2021` is not satisfied
33+
error[E0277]: the trait bound `i32: Try` is not satisfied
3334
--> $DIR/try-block-bad-type.rs:20:26
3435
|
3536
LL | let res: i32 = try { 5 };
36-
| ^ the trait `Try2021` is not implemented for `i32`
37+
| ^ the trait `Try` is not implemented for `i32`
3738
|
3839
= note: required by `from_output`
3940

src/test/ui/try-block/try-block-in-while.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
fn main() {
66
while try { false } {}
7-
//~^ ERROR the trait bound `bool: Try2021` is not satisfied
7+
//~^ ERROR the trait bound `bool: Try` is not satisfied
88
}

src/test/ui/try-block/try-block-in-while.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0277]: the trait bound `bool: Try2021` is not satisfied
1+
error[E0277]: the trait bound `bool: Try` is not satisfied
22
--> $DIR/try-block-in-while.rs:6:17
33
|
44
LL | while try { false } {}
5-
| ^^^^^ the trait `Try2021` is not implemented for `bool`
5+
| ^^^^^ the trait `Try` is not implemented for `bool`
66
|
77
= note: required by `from_output`
88

src/test/ui/try-block/try-block-type-error.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0271]: type mismatch resolving `<Option<f32> as Try2021>::Ok == {integer}`
1+
error[E0271]: type mismatch resolving `<Option<f32> as Try>::Ok == {integer}`
22
--> $DIR/try-block-type-error.rs:10:9
33
|
44
LL | 42
@@ -7,7 +7,7 @@ LL | 42
77
| expected `f32`, found integer
88
| help: use a float literal: `42.0`
99

10-
error[E0271]: type mismatch resolving `<Option<i32> as Try2021>::Ok == ()`
10+
error[E0271]: type mismatch resolving `<Option<i32> as Try>::Ok == ()`
1111
--> $DIR/try-block-type-error.rs:16:5
1212
|
1313
LL | };

src/test/ui/try-operator-on-main.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | | try_trait_generic::<()>();
1111
LL | | }
1212
| |_- this function should return `Result` or `Option` to accept `?`
1313
|
14-
= help: the trait `FromResidual<std::result::Result<!, std::io::Error>>` is not implemented for `()`
14+
= help: the trait `FromResidual<Result<!, std::io::Error>>` is not implemented for `()`
1515
= note: required by `from_residual`
1616

1717
error[E0277]: the `?` operator can only be applied to values that implement `Try`

src/test/ui/try-trait/try-control-flow-in-result.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu
33
|
44
LL | / fn demo() -> Result<(), ()> {
55
LL | | returns_control_flow()?;
6-
| | ^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `std::result::Result<(), ()>`
6+
| | ^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `Result<(), ()>`
77
LL | | Ok(())
88
LL | | }
99
| |_- this function should return `Result` or `Option` to accept `?`
1010
|
11-
= help: the trait `FromResidual<ControlFlow<(), !>>` is not implemented for `std::result::Result<(), ()>`
11+
= help: the trait `FromResidual<ControlFlow<(), !>>` is not implemented for `Result<(), ()>`
1212
= note: required by `from_residual`
1313

1414
error: aborting due to previous error

src/test/ui/try-trait/try-on-option.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | x?;
88
| ^^ the trait `From<result::sadness::PleaseCallTheOkOrMethodToUseQuestionMarkOnOptionsInAMethodThatReturnsResult>` is not implemented for `()`
99
|
1010
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
11-
= note: required because of the requirements on the impl of `FromResidual<Option<!>>` for `std::result::Result<u32, ()>`
11+
= note: required because of the requirements on the impl of `FromResidual<Option<!>>` for `Result<u32, ()>`
1212
= note: required by `from_residual`
1313

1414
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)

0 commit comments

Comments
 (0)