Files
rust/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
391 B
Rust
Raw Normal View History

//@ compile-flags: -Zinline-mir=no
#![crate_type = "lib"]
#[inline]
pub fn inlined_fn(x: i32, y: i32) -> i32 {
2024-05-29 14:25:55 +10:00
let closure = |a, b| a + b;
closure(x, y)
}
pub fn inlined_fn_generic<T>(x: i32, y: i32, z: T) -> (i32, T) {
2024-05-29 14:25:55 +10:00
let closure = |a, b| a + b;
(closure(x, y), z)
}
pub fn non_inlined_fn(x: i32, y: i32) -> i32 {
2024-05-29 14:25:55 +10:00
let closure = |a, b| a + b;
closure(x, y)
}