// edition:2021 // check-pass #![feature(return_type_notation)] //~^ WARN the feature `return_type_notation` is incomplete use std::future::Future; struct JoinHandle(fn() -> T); fn spawn(_: impl Future) -> JoinHandle { todo!() } trait Foo { async fn bar(&self) -> i32; } trait SendFoo: Foo + Send {} fn foobar(foo: impl SendFoo) -> JoinHandle { spawn(async move { let future = foo.bar(); future.await }) } fn main() {}