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