//@ edition: 2021 use std::future::Future; fn invalid_future() -> impl Future {} //~^ ERROR `()` is not a future fn create_complex_future() -> impl Future { async { &|| async { invalid_future().await } } } fn coerce_impl_trait() -> impl Future { create_complex_future() } trait ReturnsSend {} impl ReturnsSend for F where F: Fn() -> R, R: Send, { } fn main() {}