1
1
error[E0277]: `?` couldn't convert the error to `u8`
2
- --> $DIR/bad-interconversion.rs:6 :20
2
+ --> $DIR/bad-interconversion.rs:4 :20
3
3
|
4
4
LL | fn result_to_result() -> Result<u64, u8> {
5
5
| --------------- expected `u8` because of this
@@ -15,7 +15,7 @@ LL | Ok(Err(123_i32)?)
15
15
= note: required for `Result<u64, u8>` to implement `FromResidual<Result<Infallible, i32>>`
16
16
17
17
error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
18
- --> $DIR/bad-interconversion.rs:11 :12
18
+ --> $DIR/bad-interconversion.rs:9 :12
19
19
|
20
20
LL | fn option_to_result() -> Result<u64, String> {
21
21
| -------------------------------------------- this function returns a `Result`
@@ -26,7 +26,7 @@ LL | Some(3)?;
26
26
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
27
27
28
28
error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result`
29
- --> $DIR/bad-interconversion.rs:17 :31
29
+ --> $DIR/bad-interconversion.rs:15 :31
30
30
|
31
31
LL | fn control_flow_to_result() -> Result<u64, String> {
32
32
| -------------------------------------------------- this function returns a `Result`
@@ -37,7 +37,7 @@ LL | Ok(ControlFlow::Break(123)?)
37
37
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
38
38
39
39
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
40
- --> $DIR/bad-interconversion.rs:22 :22
40
+ --> $DIR/bad-interconversion.rs:20 :22
41
41
|
42
42
LL | fn result_to_option() -> Option<u16> {
43
43
| ------------------------------------ this function returns an `Option`
@@ -48,7 +48,7 @@ LL | Some(Err("hello")?)
48
48
= help: the trait `FromResidual<Option<Infallible>>` is implemented for `Option<T>`
49
49
50
50
error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option`
51
- --> $DIR/bad-interconversion.rs:27 :33
51
+ --> $DIR/bad-interconversion.rs:25 :33
52
52
|
53
53
LL | fn control_flow_to_option() -> Option<u64> {
54
54
| ------------------------------------------ this function returns an `Option`
@@ -59,7 +59,7 @@ LL | Some(ControlFlow::Break(123)?)
59
59
= help: the trait `FromResidual<Option<Infallible>>` is implemented for `Option<T>`
60
60
61
61
error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
62
- --> $DIR/bad-interconversion.rs:32 :39
62
+ --> $DIR/bad-interconversion.rs:30 :39
63
63
|
64
64
LL | fn result_to_control_flow() -> ControlFlow<String> {
65
65
| -------------------------------------------------- this function returns a `ControlFlow`
@@ -71,7 +71,7 @@ LL | ControlFlow::Continue(Err("hello")?)
71
71
= help: for that trait implementation, expected `ControlFlow<String, Infallible>`, found `Result<Infallible, &str>`
72
72
73
73
error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
74
- --> $DIR/bad-interconversion.rs:37 :12
74
+ --> $DIR/bad-interconversion.rs:35 :12
75
75
|
76
76
LL | fn option_to_control_flow() -> ControlFlow<u64> {
77
77
| ----------------------------------------------- this function returns a `ControlFlow`
@@ -83,7 +83,7 @@ LL | Some(3)?;
83
83
= help: for that trait implementation, expected `ControlFlow<u64, Infallible>`, found `Option<Infallible>`
84
84
85
85
error[E0277]: the `?` operator in a function that returns `ControlFlow<B, _>` can only be used on other `ControlFlow<B, _>`s (with the same Break type)
86
- --> $DIR/bad-interconversion.rs:43 :29
86
+ --> $DIR/bad-interconversion.rs:41 :29
87
87
|
88
88
LL | fn control_flow_to_control_flow() -> ControlFlow<i64> {
89
89
| ----------------------------------------------------- this function returns a `ControlFlow`
0 commit comments