summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/inline/cycle.rs
blob: 1b74d818451e7d78da45b682563db9049b4130f7 (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: -Zinline-mir-hint-threshold=1000

// EMIT_MIR cycle.f.Inline.diff
#[inline(always)]
fn f(g: impl Fn()) {
    g();
}

// EMIT_MIR cycle.g.Inline.diff
#[inline(always)]
fn g() {
    f(main);
}

// EMIT_MIR cycle.main.Inline.diff
fn main() {
    f(g);
}