1
Fork 0
rust/src/test/mir-opt/inline/inline-closure.rs

14 lines
271 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-04-04 17:15:01 +00:00
// EMIT_MIR rustc.foo.Inline.after.mir
fn foo<T: Copy>(_t: T, q: i32) -> i32 {
let x = |_t, _q| _t;
2017-11-14 22:29:09 +09:00
x(q, q)
}