]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/issue-102605.stderr
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[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 `Result<(), _>`, found opaque type
6    |     |
7    |     arguments to this function are incorrect
8    |
9    = note:     expected enum `Result<(), _>`
10            found opaque type `impl Future<Output = Result<(), String>>`
11 note: function defined here
12   --> $DIR/issue-102605.rs:7:4
13    |
14 LL | fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
15    |    ^^^^^^^^^^^^^^       ---------------
16 help: consider `await`ing on the `Future`
17    |
18 LL |     convert_result(foo().await)
19    |                         ++++++
20 help: try wrapping the expression in `Err`
21    |
22 LL |     convert_result(Err(foo()))
23    |                    ++++     +
24
25 error[E0277]: `main` has invalid return type `Option<()>`
26   --> $DIR/issue-102605.rs:11:14
27    |
28 LL | fn main() -> Option<()> {
29    |              ^^^^^^^^^^ `main` can only return types that implement `Termination`
30    |
31    = help: consider using `()`, or a `Result`
32
33 error: aborting due to 2 previous errors
34
35 Some errors have detailed explanations: E0277, E0308.
36 For more information about an error, try `rustc --explain E0277`.