2024-08-10 12:19:38 -04:00
|
|
|
//@ compile-flags: -Zinline-mir=no
|
|
|
|
|
|
2016-04-26 10:51:14 -07:00
|
|
|
#![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;
|
2016-04-26 10:51:14 -07:00
|
|
|
|
|
|
|
|
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;
|
2016-04-26 10:51:14 -07:00
|
|
|
|
|
|
|
|
(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;
|
2016-04-26 10:51:14 -07:00
|
|
|
|
|
|
|
|
closure(x, y)
|
|
|
|
|
}
|