4 // This test case is meant to demonstrate how close we can get to async
5 // functions in dyn traits with the current level of dyn* support.
8 #![allow(incomplete_features)]
10 use std::future::Future;
12 trait DynAsyncCounter {
13 fn increment<'a>(&'a mut self) -> dyn* Future<Output = usize> + 'a;
20 impl DynAsyncCounter for MyCounter {
21 fn increment<'a>(&'a mut self) -> dyn* Future<Output = usize> + 'a {
29 async fn do_counter(counter: &mut dyn DynAsyncCounter) -> usize {
30 counter.increment().await
34 let mut counter = MyCounter { count: 0 };
35 let _ = do_counter(&mut counter);