blob: 21aa3c7aafd8cdd8635a45fa8e76bed2e79f143d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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();
}
|