2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2023-06-04 19:21:00 -05:00
|
|
|
// compile-flags: -Zinline-mir-hint-threshold=1000
|
2020-11-10 18:00:00 -06:00
|
|
|
#![feature(generators, generator_trait)]
|
|
|
|
|
|
|
|
use std::ops::Generator;
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
// EMIT_MIR inline_generator.main.Inline.diff
|
|
|
|
fn main() {
|
|
|
|
let _r = Pin::new(&mut g()).resume(false);
|
|
|
|
}
|
|
|
|
|
2023-06-04 19:21:00 -05:00
|
|
|
#[inline]
|
2020-11-10 18:00:00 -06:00
|
|
|
pub fn g() -> impl Generator<bool> {
|
2023-06-04 19:21:00 -05:00
|
|
|
#[inline]
|
2020-11-10 18:00:00 -06:00
|
|
|
|a| { yield if a { 7 } else { 13 } }
|
|
|
|
}
|