diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-10-19 21:46:28 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-10-20 21:14:01 +0000 |
| commit | e96ce20b34789d29e925425da6cf138927b80a79 (patch) | |
| tree | 4032e01ddd5137d1ee98b69277953f2962bbf14b /tests/mir-opt/inline/inline_coroutine.rs | |
| parent | 60956837cfbf22bd8edd80f57a856e141f7deb8c (diff) | |
| download | rust-e96ce20b34789d29e925425da6cf138927b80a79.tar.gz rust-e96ce20b34789d29e925425da6cf138927b80a79.zip | |
s/generator/coroutine/
Diffstat (limited to 'tests/mir-opt/inline/inline_coroutine.rs')
| -rw-r--r-- | tests/mir-opt/inline/inline_coroutine.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/mir-opt/inline/inline_coroutine.rs b/tests/mir-opt/inline/inline_coroutine.rs new file mode 100644 index 00000000000..d021cdac28e --- /dev/null +++ b/tests/mir-opt/inline/inline_coroutine.rs @@ -0,0 +1,18 @@ +// skip-filecheck +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY +// compile-flags: -Zinline-mir-hint-threshold=1000 +#![feature(coroutines, coroutine_trait)] + +use std::ops::Coroutine; +use std::pin::Pin; + +// EMIT_MIR inline_coroutine.main.Inline.diff +fn main() { + let _r = Pin::new(&mut g()).resume(false); +} + +#[inline] +pub fn g() -> impl Coroutine<bool> { + #[inline] + |a| { yield if a { 7 } else { 13 } } +} |
