rust/tests/mir-opt/inline/inline_closure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
355 B
Rust
Raw Normal View History

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