blob: 2c2d556f9a9a596e29a5a3451c75dd1b6e70b818 [file] [log] [blame]
//@ compile-flags: -Z span_free_formats
// Tests that MIR inliner can handle closure captures.
fn main() {
println!("{:?}", foo(0, 14));
}
// EMIT_MIR inline_closure_captures.foo.Inline.after.mir
fn foo<T: Copy>(t: T, q: i32) -> (i32, T) {
let x = |_q| (q, t);
// CHECK-LABEL: fn foo(
// CHECK: (inlined foo::<T>::{closure#0})
x(q)
}