]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/type-mismatch-signature-deduction.stderr
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
[rust.git] / src / test / ui / generator / type-mismatch-signature-deduction.stderr
1 error[E0308]: mismatched types
2   --> $DIR/type-mismatch-signature-deduction.rs:14:9
3    |
4 LL |         5
5    |         ^ expected enum `Result`, found integer
6    |
7    = note: expected enum `Result<{integer}, _>`
8               found type `{integer}`
9 note: return type inferred to be `Result<{integer}, _>` here
10   --> $DIR/type-mismatch-signature-deduction.rs:9:20
11    |
12 LL |             return Ok(6);
13    |                    ^^^^^
14 help: try wrapping the expression in a variant of `Result`
15    |
16 LL |         Ok(5)
17    |         +++ +
18 LL |         Err(5)
19    |         ++++ +
20
21 error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:7:5: 7:7] as Generator>::Return == i32`
22   --> $DIR/type-mismatch-signature-deduction.rs:5:13
23    |
24 LL | fn foo() -> impl Generator<Return = i32> {
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `i32`
26    |
27    = note: expected enum `Result<{integer}, _>`
28               found type `i32`
29
30 error: aborting due to 2 previous errors
31
32 Some errors have detailed explanations: E0271, E0308.
33 For more information about an error, try `rustc --explain E0271`.