From cf2dff2b1e3fa55fa5415d524200070d0d7aacfe Mon Sep 17 00:00:00 2001 From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:13:28 +0100 Subject: Move /src/test to /tests --- tests/mir-opt/inline/inline_closure_captures.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/mir-opt/inline/inline_closure_captures.rs (limited to 'tests/mir-opt/inline/inline_closure_captures.rs') diff --git a/tests/mir-opt/inline/inline_closure_captures.rs b/tests/mir-opt/inline/inline_closure_captures.rs new file mode 100644 index 00000000000..52b6817e401 --- /dev/null +++ b/tests/mir-opt/inline/inline_closure_captures.rs @@ -0,0 +1,13 @@ +// compile-flags: -Z span_free_formats + +// Tests that MIR inliner can handle closure captures. + +fn main() { + println!("{:?}", foo(0, 14)); +} + +// EMIT_MIR inline_closure_captures.foo.Inline.after.mir +fn foo(t: T, q: i32) -> (i32, T) { + let x = |_q| (q, t); + x(q) +} -- cgit 1.4.1-3-g733a5