2024-05-11 18:29:07 -05:00
|
|
|
// We specify incremental here because we want to test the partitioning for incremental compilation
|
2021-09-19 11:57:19 -05:00
|
|
|
//@ incremental
|
|
|
|
//@ compile-flags:-Zprint-mono-items=eager -Zshare-generics=y
|
2016-03-24 10:40:49 -05:00
|
|
|
|
|
|
|
#![allow(dead_code)]
|
2024-05-28 23:25:55 -05:00
|
|
|
#![crate_type = "lib"]
|
2016-03-24 10:40:49 -05:00
|
|
|
|
|
|
|
//@ aux-build:cgu_generic_function.rs
|
|
|
|
extern crate cgu_generic_function;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn user @@ extern_generic[Internal]
|
2016-03-24 10:40:49 -05:00
|
|
|
fn user() {
|
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
|
|
|
|
mod mod1 {
|
|
|
|
use cgu_generic_function;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn mod1::user @@ extern_generic-mod1[Internal]
|
2016-03-24 10:40:49 -05:00
|
|
|
fn user() {
|
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
|
|
|
|
mod mod1 {
|
|
|
|
use cgu_generic_function;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn mod1::mod1::user @@ extern_generic-mod1-mod1[Internal]
|
2016-03-24 10:40:49 -05:00
|
|
|
fn user() {
|
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod mod2 {
|
|
|
|
use cgu_generic_function;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn mod2::user @@ extern_generic-mod2[Internal]
|
2016-03-24 10:40:49 -05:00
|
|
|
fn user() {
|
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod mod3 {
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn mod3::non_user @@ extern_generic-mod3[Internal]
|
2016-03-24 10:40:49 -05:00
|
|
|
fn non_user() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make sure the two generic functions from the extern crate get instantiated
|
2017-01-09 08:52:08 -06:00
|
|
|
// once for the current crate
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn cgu_generic_function::foo::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External]
|
|
|
|
//~ MONO_ITEM fn cgu_generic_function::bar::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External]
|