mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
16 lines
405 B
Rust
16 lines
405 B
Rust
//@ 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 ctx = &mut Context::from_waker(Waker::noop());
|
|
async_iterator.poll_next(ctx);
|
|
}
|