]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/opaque-type-error.rs
Rollup merge of #107264 - ferrocene:pa-private-items, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / opaque-type-error.rs
1 // edition:2018
2 use core::future::Future;
3
4 async fn base_thing() -> Result<(), ()> {
5     Ok(())
6 }
7
8 fn thing_one() -> impl Future<Output = Result<(), ()>> {
9     base_thing()
10 }
11
12 fn thing_two() -> impl Future<Output = Result<(), ()>> {
13     base_thing()
14 }
15
16 async fn thing() -> Result<(), ()> {
17     if true {
18         thing_one()
19     } else {
20         thing_two() //~ ERROR `if` and `else` have incompatible types
21     }.await
22 }
23
24 fn main() {}