diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-07 16:06:52 +0000 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-07 16:18:31 +0000 | 
| commit | dcca9a12cdda3be34ed74beca05d72c77d797e7f (patch) | |
| tree | 4c4d6e481fedab322aa8729f9e96ff8cc2278660 /tests/ui/coroutine/polymorphize-args.rs | |
| parent | d6c46a23ce19e910225abacc33bcca9d0f549148 (diff) | |
| download | rust-dcca9a12cdda3be34ed74beca05d72c77d797e7f.tar.gz rust-dcca9a12cdda3be34ed74beca05d72c77d797e7f.zip | |
Record coroutine kind in generics
Diffstat (limited to 'tests/ui/coroutine/polymorphize-args.rs')
| -rw-r--r-- | tests/ui/coroutine/polymorphize-args.rs | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/tests/ui/coroutine/polymorphize-args.rs b/tests/ui/coroutine/polymorphize-args.rs new file mode 100644 index 00000000000..de44d667656 --- /dev/null +++ b/tests/ui/coroutine/polymorphize-args.rs @@ -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(); +} | 
