about summary refs log tree commit diff
path: root/tests/mir-opt/inline/forced_closure_inherent.rs
blob: 949c7d6ecbf282a6ece9a185ca66edb5d9513239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ compile-flags: -Copt-level=0 --crate-type=lib
#![feature(rustc_attrs)]

struct Foo {}

impl Foo {
    #[rustc_force_inline]
    pub fn callee_forced() {}
}

// EMIT_MIR forced_closure_inherent.caller-{closure#0}.ForceInline.diff
pub fn caller() {
    (|| {
        Foo::callee_forced();
        // CHECK-LABEL: fn caller::{closure#0}(
        // CHECK: (inlined Foo::callee_forced)
    })();
}