rust/tests/ui/coroutine/type-mismatch-signature-ded...

34 lines
1.1 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/type-mismatch-signature-deduction.rs:15:9
|
LL | 5
| ^ expected `Result<{integer}, _>`, found integer
|
= note: expected enum `Result<{integer}, _>`
found type `{integer}`
note: return type inferred to be `Result<{integer}, _>` here
--> $DIR/type-mismatch-signature-deduction.rs:10:20
|
LL | return Ok(6);
| ^^^^^
help: try wrapping the expression in a variant of `Result`
|
LL | Ok(5)
| +++ +
LL | Err(5)
| ++++ +
error[E0271]: type mismatch resolving `<{coroutine@$DIR/type-mismatch-signature-deduction.rs:8:5: 8:7} as Coroutine>::Return == i32`
--> $DIR/type-mismatch-signature-deduction.rs:5:13
|
LL | fn foo() -> impl Coroutine<Return = i32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<{integer}, _>`, found `i32`
|
= note: expected enum `Result<{integer}, _>`
found type `i32`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0271, E0308.
For more information about an error, try `rustc --explain E0271`.