Skip to content

Commit 9b5766c

Browse files
committed
Bless the UI tests
1 parent 944ba8c commit 9b5766c

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
error[E0284]: type annotations needed
2-
--> $DIR/question-mark-type-infer.rs:10:21
1+
error[E0282]: type annotations needed
2+
--> $DIR/question-mark-type-infer.rs:10:30
33
|
44
LL | l.iter().map(f).collect()?
5-
| ^^^^^^^ cannot infer type
6-
|
7-
= note: cannot satisfy `<_ as Try>::Residual == _`
8-
help: consider specifying the type argument in the method call
9-
|
10-
LL | l.iter().map(f).collect::<B>()?
11-
| +++++
5+
| ^ cannot infer type
126

137
error: aborting due to previous error
148

15-
For more information about this error, try `rustc --explain E0284`.
9+
For more information about this error, try `rustc --explain E0282`.

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ 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-
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
10+
= help: the following other types implement trait `FromResidual<R>`:
11+
<Result<T, F> as FromResidual<Result<Infallible, E>>>
12+
<Result<T, F> as FromResidual<Yeet<E>>>
1113
= note: required because of the requirements on the impl of `FromResidual<Result<Infallible, {integer}>>` for `Result<i32, ()>`
1214

1315
error: aborting due to previous error

src/test/ui/try-trait/bad-interconversion.stderr

+12-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ LL | | }
3131
| |_- this function returns a `Result`
3232
|
3333
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u64, String>`
34-
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
34+
= help: the following other types implement trait `FromResidual<R>`:
35+
<Result<T, F> as FromResidual<Result<Infallible, E>>>
36+
<Result<T, F> as FromResidual<Yeet<E>>>
3537

3638
error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result`
3739
--> $DIR/bad-interconversion.rs:17:31
@@ -44,7 +46,9 @@ LL | | }
4446
| |_- this function returns a `Result`
4547
|
4648
= help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Result<u64, String>`
47-
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
49+
= help: the following other types implement trait `FromResidual<R>`:
50+
<Result<T, F> as FromResidual<Result<Infallible, E>>>
51+
<Result<T, F> as FromResidual<Yeet<E>>>
4852

4953
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
5054
--> $DIR/bad-interconversion.rs:22:22
@@ -57,7 +61,9 @@ LL | | }
5761
| |_- this function returns an `Option`
5862
|
5963
= help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `Option<u16>`
60-
= help: the trait `FromResidual` is implemented for `Option<T>`
64+
= help: the following other types implement trait `FromResidual<R>`:
65+
<Option<T> as FromResidual<Yeet<()>>>
66+
<Option<T> as FromResidual>
6167

6268
error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option`
6369
--> $DIR/bad-interconversion.rs:27:33
@@ -70,7 +76,9 @@ LL | | }
7076
| |_- this function returns an `Option`
7177
|
7278
= help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Option<u64>`
73-
= help: the trait `FromResidual` is implemented for `Option<T>`
79+
= help: the following other types implement trait `FromResidual<R>`:
80+
<Option<T> as FromResidual<Yeet<()>>>
81+
<Option<T> as FromResidual>
7482

7583
error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
7684
--> $DIR/bad-interconversion.rs:32:39

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ LL | | }
1010
| |_- this function returns a `Result`
1111
|
1212
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<(), ()>`
13-
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
13+
= help: the following other types implement trait `FromResidual<R>`:
14+
<Result<T, F> as FromResidual<Result<Infallible, E>>>
15+
<Result<T, F> as FromResidual<Yeet<E>>>
1416

1517
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
1618
--> $DIR/option-to-result.rs:11:6
@@ -24,7 +26,9 @@ LL | | }
2426
| |_- this function returns an `Option`
2527
|
2628
= help: the trait `FromResidual<Result<Infallible, i32>>` is not implemented for `Option<i32>`
27-
= help: the trait `FromResidual` is implemented for `Option<T>`
29+
= help: the following other types implement trait `FromResidual<R>`:
30+
<Option<T> as FromResidual<Yeet<()>>>
31+
<Option<T> as FromResidual>
2832

2933
error: aborting due to 2 previous errors
3034

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ LL | | }
1010
| |_- this function returns a `Result`
1111
|
1212
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u32, ()>`
13-
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
13+
= help: the following other types implement trait `FromResidual<R>`:
14+
<Result<T, F> as FromResidual<Result<Infallible, E>>>
15+
<Result<T, F> as FromResidual<Yeet<E>>>
1416

1517
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
1618
--> $DIR/try-on-option.rs:11:6

0 commit comments

Comments
 (0)