1 // Currently, all generic functions are instantiated in each codegen unit that
2 // uses them, even those not marked with #[inline], so this test does not make
3 // much sense at the moment.
7 // We specify incremental here because we want to test the partitioning for
8 // incremental compilation
10 // compile-flags:-Zprint-mono-items=lazy
17 struct SomeGenericType
<T1
, T2
>(T1
, T2
);
20 use super::{SomeType, SomeGenericType}
;
22 // Even though the impl is in `mod1`, the methods should end up in the
23 // parent module, since that is where their self-type is.
25 //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[0]::method[0] @@ methods_are_with_self_type[External]
28 //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[0]::associated_fn[0] @@ methods_are_with_self_type[External]
32 impl<T1
, T2
> SomeGenericType
<T1
, T2
> {
33 pub fn method(&self) {}
34 pub fn associated_fn(_
: T1
, _
: T2
) {}
43 // We provide an implementation of `Trait` for all types. The corresponding
44 // monomorphizations should end up in whichever module the concrete `T` is.
58 //~ MONO_ITEM fn methods_are_with_self_type::start[0]
60 fn start(_
: isize, _
: *const *const u8) -> isize {
61 //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::method[0]<u32, u64> @@ methods_are_with_self_type.volatile[WeakODR]
62 SomeGenericType(0u32, 0u64).method();
63 //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::associated_fn[0]<char, &str> @@ methods_are_with_self_type.volatile[WeakODR]
64 SomeGenericType
::associated_fn('c'
, "&str");
66 //~ MONO_ITEM fn methods_are_with_self_type::{{impl}}[0]::foo[0]<methods_are_with_self_type::type1[0]::Struct[0]> @@ methods_are_with_self_type-type1.volatile[WeakODR]
68 //~ MONO_ITEM fn methods_are_with_self_type::{{impl}}[0]::foo[0]<methods_are_with_self_type::type2[0]::Struct[0]> @@ methods_are_with_self_type-type2.volatile[WeakODR]
71 //~ MONO_ITEM fn methods_are_with_self_type::Trait[0]::default[0]<methods_are_with_self_type::type1[0]::Struct[0]> @@ methods_are_with_self_type-type1.volatile[WeakODR]
72 type1
::Struct
.default();
73 //~ MONO_ITEM fn methods_are_with_self_type::Trait[0]::default[0]<methods_are_with_self_type::type2[0]::Struct[0]> @@ methods_are_with_self_type-type2.volatile[WeakODR]
74 type2
::Struct
.default();
79 //~ MONO_ITEM drop-glue i8