2024-04-14 18:22:35 -07:00
|
|
|
//@ compile-flags: -Z span_free_formats -C debuginfo=full
|
2017-11-10 23:06:06 +09:00
|
|
|
|
|
|
|
// Tests that MIR inliner can handle closure arguments. (#45894)
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{}", foo(0, 14));
|
|
|
|
}
|
|
|
|
|
2020-07-27 21:22:43 +02:00
|
|
|
// EMIT_MIR inline_closure.foo.Inline.after.mir
|
2017-11-10 23:06:06 +09:00
|
|
|
fn foo<T: Copy>(_t: T, q: i32) -> i32 {
|
|
|
|
let x = |_t, _q| _t;
|
2023-10-20 11:31:05 -07:00
|
|
|
|
|
|
|
// CHECK-LABEL: fn foo(
|
|
|
|
// CHECK: (inlined foo::<T>::{closure#0})
|
2017-11-14 22:29:09 +09:00
|
|
|
x(q, q)
|
2017-11-10 23:06:06 +09:00
|
|
|
}
|