blob: aac74d3eacba88356b93b3e8cba40e40340e38e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// compile-flags: --edition 2024 -Zunstable-options
// check-pass
#![feature(async_iterator, gen_blocks, noop_waker)]
use std::{async_iter::AsyncIterator, pin::pin, task::{Context, Waker}};
async gen fn gen_fn() -> &'static str {
yield "hello"
}
pub fn main() {
let async_iterator = pin!(gen_fn());
let waker = Waker::noop();
let ctx = &mut Context::from_waker(&waker);
async_iterator.poll_next(ctx);
}
|