about summary refs log tree commit diff
path: root/tests/ui/coroutine/polymorphize-args.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-02-07 16:06:52 +0000
committerMichael Goulet <michael@errs.io>2024-02-07 16:18:31 +0000
commitdcca9a12cdda3be34ed74beca05d72c77d797e7f (patch)
tree4c4d6e481fedab322aa8729f9e96ff8cc2278660 /tests/ui/coroutine/polymorphize-args.rs
parentd6c46a23ce19e910225abacc33bcca9d0f549148 (diff)
downloadrust-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.rs17
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();
+}