mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
14 lines
282 B
Rust
14 lines
282 B
Rust
// 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: Copy>(t: T, q: i32) -> (i32, T) {
|
|
let x = |_q| (q, t);
|
|
x(q)
|
|
}
|