summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/inline/inline_closure.rs
blob: 715fd0138a743da7103c456f1bab84ecb4ac6d82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// compile-flags: -Z span_free_formats

// Tests that MIR inliner can handle closure arguments. (#45894)

fn main() {
    println!("{}", foo(0, 14));
}

// EMIT_MIR inline_closure.foo.Inline.after.mir
fn foo<T: Copy>(_t: T, q: i32) -> i32 {
    let x = |_t, _q| _t;
    x(q, q)
}