rust/tests/ui/coroutine/polymorphize-args.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
379 B
Rust
Raw Normal View History

2024-02-07 10:06:52 -06:00
//@ compile-flags: -Zpolymorphize=on
//@ build-pass
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
2024-02-07 10:06:52 -06:00
use std::ops::Coroutine;
use std::pin::Pin;
use std::thread;
fn main() {
let mut foo = #[coroutine]
|| yield;
2024-02-07 10:06:52 -06:00
thread::spawn(move || match Pin::new(&mut foo).resume(()) {
s => panic!("bad state: {:?}", s),
})
.join()
.unwrap();
}