1
Fork 0

Record coroutine kind in generics

This commit is contained in:
Michael Goulet 2024-02-07 16:06:52 +00:00
parent d6c46a23ce
commit dcca9a12cd
3 changed files with 35 additions and 4 deletions

View file

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