Record coroutine kind in generics
This commit is contained in:
parent
d6c46a23ce
commit
dcca9a12cd
3 changed files with 35 additions and 4 deletions
17
tests/ui/coroutine/polymorphize-args.rs
Normal file
17
tests/ui/coroutine/polymorphize-args.rs
Normal 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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue