1 error[E0308]: mismatched types
2 --> $DIR/issue-102605.rs:13:20
4 LL | convert_result(foo())
5 | -------------- ^^^^^ expected enum `Result`, found opaque type
7 | arguments to this function are incorrect
9 note: while checking the return type of the `async fn`
10 --> $DIR/issue-102605.rs:3:19
12 LL | async fn foo() -> Result<(), String> {
13 | ^^^^^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, found opaque type
14 = note: expected enum `Result<(), _>`
15 found opaque type `impl Future<Output = Result<(), String>>`
16 note: function defined here
17 --> $DIR/issue-102605.rs:7:4
19 LL | fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
20 | ^^^^^^^^^^^^^^ ---------------
21 help: consider `await`ing on the `Future`
23 LL | convert_result(foo().await)
25 help: try wrapping the expression in `Err`
27 LL | convert_result(Err(foo()))
30 error[E0277]: `main` has invalid return type `Option<()>`
31 --> $DIR/issue-102605.rs:11:14
33 LL | fn main() -> Option<()> {
34 | ^^^^^^^^^^ `main` can only return types that implement `Termination`
36 = help: consider using `()`, or a `Result`
38 error: aborting due to 2 previous errors
40 Some errors have detailed explanations: E0277, E0308.
41 For more information about an error, try `rustc --explain E0277`.