]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/inline/inline_closure_captures.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / mir-opt / inline / inline_closure_captures.rs
1 // compile-flags: -Z span_free_formats
2
3 // Tests that MIR inliner can handle closure captures.
4
5 fn main() {
6     println!("{:?}", foo(0, 14));
7 }
8
9 // EMIT_MIR inline_closure_captures.foo.Inline.after.mir
10 fn foo<T: Copy>(t: T, q: i32) -> (i32, T) {
11     let x = |_q| (q, t);
12     x(q)
13 }