4 #![feature(async_fn_in_trait)]
5 #![allow(incomplete_features)]
7 use std::future::Future;
9 async fn yield_now() {}
13 async fn next(&mut self) -> Option<Self::Item>;
16 struct YieldingRange {
21 impl AsyncIterator for YieldingRange {
24 async fn next(&mut self) -> Option<Self::Item> {
25 if self.counter == self.stop {
36 async fn async_main() {
37 let mut x = YieldingRange { counter: 0, stop: 10 };
39 while let Some(v) = x.next().await {