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