]> git.proxmox.com Git - rustc.git/blame - tests/mir-opt/inline/inline_closure.rs
New upstream version 1.75.0+dfsg1
[rustc.git] / tests / mir-opt / inline / inline_closure.rs
CommitLineData
abe05a73
XL
1// compile-flags: -Z span_free_formats
2
3// Tests that MIR inliner can handle closure arguments. (#45894)
4
5fn main() {
6 println!("{}", foo(0, 14));
7}
8
3dfed10e 9// EMIT_MIR inline_closure.foo.Inline.after.mir
abe05a73
XL
10fn foo<T: Copy>(_t: T, q: i32) -> i32 {
11 let x = |_t, _q| _t;
ed00b5ec
FG
12
13 // CHECK-LABEL: fn foo(
14 // CHECK: (inlined foo::<T>::{closure#0})
abe05a73
XL
15 x(q, q)
16}