]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/issue-102605.stderr
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / impl-trait / issue-102605.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-102605.rs:13:20
3    |
4 LL |     convert_result(foo())
5    |     -------------- ^^^^^ expected enum `Result`, found opaque type
6    |     |
7    |     arguments to this function are incorrect
8    |
9 note: while checking the return type of the `async fn`
10   --> $DIR/issue-102605.rs:3:19
11    |
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
18    |
19 LL | fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
20    |    ^^^^^^^^^^^^^^       ---------------
21 help: consider `await`ing on the `Future`
22    |
23 LL |     convert_result(foo().await)
24    |                         ++++++
25 help: try wrapping the expression in `Err`
26    |
27 LL |     convert_result(Err(foo()))
28    |                    ++++     +
29
30 error[E0277]: `main` has invalid return type `Option<()>`
31   --> $DIR/issue-102605.rs:11:14
32    |
33 LL | fn main() -> Option<()> {
34    |              ^^^^^^^^^^ `main` can only return types that implement `Termination`
35    |
36    = help: consider using `()`, or a `Result`
37
38 error: aborting due to 2 previous errors
39
40 Some errors have detailed explanations: E0277, E0308.
41 For more information about an error, try `rustc --explain E0277`.