How do I erase the type of future in the new future API?
问题 The following does not compile #![feature(await_macro, async_await, futures_api)] use core::future::Future; async fn foo() {} trait Bar { type Output: Future<Output = ()>; fn bar(&self) -> Self::Output; } impl Bar for () { type Output = Box<dyn Future<Output = ()>>; fn bar(&self) -> Self::Output { Box::new(foo()) } } async fn buz() { await!(().bar()) } error[E0277]: the trait bound `(dyn std::future::Future<Output=()> + 'static): std::marker::Unpin` is not satisfied --> src/lib.rs:19:15 | 19