summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs
blob: 0ceb62d449a17907b4993ef2a6bee515d4e0ee54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// edition:2021
// check-pass

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

use std::future::Future;

struct JoinHandle<T>(fn() -> T);

fn spawn<T>(_: impl Future<Output = T>) -> JoinHandle<T> {
    todo!()
}

trait Foo {
    async fn bar(&self) -> i32;
}

trait SendFoo: Foo<bar(): Send> + Send {}

fn foobar(foo: impl SendFoo) -> JoinHandle<i32> {
    spawn(async move {
        let future = foo.bar();
        future.await
    })
}

fn main() {}