2024-05-11 19:29:07 -04:00
|
|
|
// We specify incremental here because we want to test the partitioning for incremental compilation
|
2021-09-19 09:57:19 -07:00
|
|
|
//@ incremental
|
|
|
|
//@ compile-flags:-Zprint-mono-items=lazy
|
2017-10-06 14:59:33 -07:00
|
|
|
//@ compile-flags:-Zinline-in-all-cgus
|
2016-03-24 11:40:49 -04:00
|
|
|
|
|
|
|
#![allow(dead_code)]
|
2024-05-29 14:25:55 +10:00
|
|
|
#![crate_type = "lib"]
|
2016-03-24 11:40:49 -04:00
|
|
|
|
|
|
|
mod inline {
|
|
|
|
|
|
|
|
// Important: This function should show up in all codegen units where it is inlined
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn inline::inlined_function @@ local_inlining-user1[Internal] local_inlining-user2[Internal]
|
2016-03-24 11:40:49 -04:00
|
|
|
#[inline(always)]
|
2024-05-29 14:25:55 +10:00
|
|
|
pub fn inlined_function() {}
|
2016-03-24 11:40:49 -04:00
|
|
|
}
|
|
|
|
|
2017-10-27 14:31:18 +02:00
|
|
|
pub mod user1 {
|
2016-03-24 11:40:49 -04:00
|
|
|
use super::inline;
|
|
|
|
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn user1::foo @@ local_inlining-user1[External]
|
2017-10-27 14:31:18 +02:00
|
|
|
pub fn foo() {
|
2016-03-24 11:40:49 -04:00
|
|
|
inline::inlined_function();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:31:18 +02:00
|
|
|
pub mod user2 {
|
2016-03-24 11:40:49 -04:00
|
|
|
use super::inline;
|
|
|
|
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn user2::bar @@ local_inlining-user2[External]
|
2017-10-27 14:31:18 +02:00
|
|
|
pub fn bar() {
|
2016-03-24 11:40:49 -04:00
|
|
|
inline::inlined_function();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:31:18 +02:00
|
|
|
pub mod non_user {
|
2016-03-24 11:40:49 -04:00
|
|
|
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn non_user::baz @@ local_inlining-non_user[External]
|
2024-05-29 14:25:55 +10:00
|
|
|
pub fn baz() {}
|
2016-03-24 11:40:49 -04:00
|
|
|
}
|