2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-04-14 20:22:35 -05:00
|
|
|
//@ compile-flags: -Zinline-mir-hint-threshold=1000 -C debuginfo=full
|
2023-10-19 16:46:28 -05:00
|
|
|
#![feature(coroutines, coroutine_trait)]
|
2020-11-10 18:00:00 -06:00
|
|
|
|
2023-10-19 11:06:43 -05:00
|
|
|
use std::ops::Coroutine;
|
2020-11-10 18:00:00 -06:00
|
|
|
use std::pin::Pin;
|
|
|
|
|
2023-10-19 16:46:28 -05:00
|
|
|
// EMIT_MIR inline_coroutine.main.Inline.diff
|
2020-11-10 18:00:00 -06:00
|
|
|
fn main() {
|
2023-10-20 20:15:32 -05:00
|
|
|
// CHECK-LABEL: fn main(
|
|
|
|
// CHECK: (inlined g)
|
|
|
|
// CHECK: (inlined g::{closure#0})
|
2020-11-10 18:00:00 -06:00
|
|
|
let _r = Pin::new(&mut g()).resume(false);
|
|
|
|
}
|
|
|
|
|
2023-06-04 19:21:00 -05:00
|
|
|
#[inline]
|
2023-10-19 11:06:43 -05:00
|
|
|
pub fn g() -> impl Coroutine<bool> {
|
2023-06-04 19:21:00 -05:00
|
|
|
#[inline]
|
2024-04-11 08:15:34 -05:00
|
|
|
#[coroutine]
|
|
|
|
|a| yield if a { 7 } else { 13 }
|
2020-11-10 18:00:00 -06:00
|
|
|
}
|