]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/opaque-type-error.stderr
skip if val has ecaping bound vars
[rust.git] / src / test / ui / suggestions / opaque-type-error.stderr
1 error[E0308]: `if` and `else` have incompatible types
2   --> $DIR/opaque-type-error.rs:20:9
3    |
4 LL |   fn thing_one() -> impl Future<Output = Result<(), ()>> {
5    |                     ------------------------------------ the expected opaque type
6 ...
7 LL |   fn thing_two() -> impl Future<Output = Result<(), ()>> {
8    |                     ------------------------------------ the found opaque type
9 ...
10 LL | /     if true {
11 LL | |         thing_one()
12    | |         ----------- expected because of this
13 LL | |     } else {
14 LL | |         thing_two()
15    | |         ^^^^^^^^^^^ expected opaque type, found a different opaque type
16 LL | |     }.await
17    | |_____- `if` and `else` have incompatible types
18    |
19    = note: expected opaque type `impl Future<Output = Result<(), ()>>` (opaque type at <$DIR/opaque-type-error.rs:8:19>)
20               found opaque type `impl Future<Output = Result<(), ()>>` (opaque type at <$DIR/opaque-type-error.rs:12:19>)
21    = note: distinct uses of `impl Trait` result in different opaque types
22 help: consider `await`ing on both `Future`s
23    |
24 LL ~         thing_one().await
25 LL |     } else {
26 LL ~         thing_two().await
27    |
28
29 error: aborting due to previous error
30
31 For more information about this error, try `rustc --explain E0308`.