diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2023-11-27 05:03:31 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2023-11-27 05:03:31 +0000 |
| commit | fa6ecc9f67cb05bf08aaa38d39dd9730991b1444 (patch) | |
| tree | 88bc4f64134af56c98ce4e82d8e43735d809e984 /compiler/rustc_codegen_cranelift/example | |
| parent | 1293a6a28100ac51153293882735d3c637fdcb35 (diff) | |
| parent | c751bfa015ab9e99f3c7845cebf04eb543648042 (diff) | |
| download | rust-fa6ecc9f67cb05bf08aaa38d39dd9730991b1444.tar.gz rust-fa6ecc9f67cb05bf08aaa38d39dd9730991b1444.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs b/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs new file mode 100644 index 00000000000..c965b34e13b --- /dev/null +++ b/compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs @@ -0,0 +1,16 @@ +#![feature(coroutines, coroutine_trait)] + +use std::ops::Coroutine; +use std::pin::Pin; + +fn main() { + run_coroutine::<i32>(); +} + +fn run_coroutine<T>() { + let mut coroutine = || { + yield; + return; + }; + Pin::new(&mut coroutine).resume(()); +} |
