summary refs log tree commit diff
path: root/tests/ui/coroutine/polymorphize-args.rs
blob: 5123bf412b553fcab925ef888d224c3fbc6f9a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ compile-flags: -Zpolymorphize=on
//@ build-pass

#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]

use std::ops::Coroutine;
use std::pin::Pin;
use std::thread;

fn main() {
    let mut foo = #[coroutine]
    || yield;
    thread::spawn(move || match Pin::new(&mut foo).resume(()) {
        s => panic!("bad state: {:?}", s),
    })
    .join()
    .unwrap();
}