|
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. |
4 | | -//@ ignore-test |
5 | | - |
6 | 1 | // We specify incremental here because we want to test the partitioning for incremental compilation |
7 | 2 | //@ incremental |
8 | 3 | //@ compile-flags:-Zprint-mono-items=lazy |
9 | 4 |
|
10 | | -#![allow(dead_code)] |
11 | | -#![feature(start)] |
| 5 | +#![crate_type = "lib"] |
12 | 6 |
|
13 | | -struct SomeType; |
| 7 | +pub struct SomeType; |
14 | 8 |
|
15 | 9 | struct SomeGenericType<T1, T2>(T1, T2); |
16 | 10 |
|
17 | | -mod mod1 { |
| 11 | +pub mod mod1 { |
18 | 12 | use super::{SomeGenericType, SomeType}; |
19 | 13 |
|
20 | 14 | // Even though the impl is in `mod1`, the methods should end up in the |
21 | 15 | // parent module, since that is where their self-type is. |
22 | 16 | impl SomeType { |
23 | | - //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[0]::method[0] @@ methods_are_with_self_type[External] |
24 | | - fn method(&self) {} |
25 | | - |
26 | | - //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[0]::associated_fn[0] @@ methods_are_with_self_type[External] |
27 | | - fn associated_fn() {} |
| 17 | + //~ MONO_ITEM fn mod1::<impl SomeType>::method @@ methods_are_with_self_type[External] |
| 18 | + pub fn method(&self) {} |
| 19 | + //~ MONO_ITEM fn mod1::<impl SomeType>::associated_fn @@ methods_are_with_self_type[External] |
| 20 | + pub fn associated_fn() {} |
28 | 21 | } |
29 | 22 |
|
30 | 23 | impl<T1, T2> SomeGenericType<T1, T2> { |
@@ -52,25 +45,20 @@ mod type2 { |
52 | 45 | pub struct Struct; |
53 | 46 | } |
54 | 47 |
|
55 | | -//~ MONO_ITEM fn methods_are_with_self_type::start[0] |
56 | | -#[start] |
57 | | -fn start(_: isize, _: *const *const u8) -> isize { |
58 | | - //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::method[0]<u32, u64> @@ methods_are_with_self_type.volatile[WeakODR] |
| 48 | +//~ MONO_ITEM fn start @@ methods_are_with_self_type[External] |
| 49 | +pub fn start() { |
| 50 | + //~ MONO_ITEM fn mod1::<impl SomeGenericType<u32, u64>>::method @@ methods_are_with_self_type.volatile[External] |
59 | 51 | SomeGenericType(0u32, 0u64).method(); |
60 | | - //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::associated_fn[0]<char, &str> @@ methods_are_with_self_type.volatile[WeakODR] |
| 52 | + //~ MONO_ITEM fn mod1::<impl SomeGenericType<char, &str>>::associated_fn @@ methods_are_with_self_type.volatile[External] |
61 | 53 | SomeGenericType::associated_fn('c', "&str"); |
62 | 54 |
|
63 | | - //~ 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] |
| 55 | + //~ MONO_ITEM fn <type1::Struct as Trait>::foo @@ methods_are_with_self_type-type1.volatile[External] |
64 | 56 | type1::Struct.foo(); |
65 | | - //~ 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] |
| 57 | + //~ MONO_ITEM fn <type2::Struct as Trait>::foo @@ methods_are_with_self_type-type2.volatile[External] |
66 | 58 | type2::Struct.foo(); |
67 | 59 |
|
68 | | - //~ 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] |
| 60 | + //~ MONO_ITEM fn <type1::Struct as Trait>::default @@ methods_are_with_self_type-type1.volatile[External] |
69 | 61 | type1::Struct.default(); |
70 | | - //~ 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] |
| 62 | + //~ MONO_ITEM fn <type2::Struct as Trait>::default @@ methods_are_with_self_type-type2.volatile[External] |
71 | 63 | type2::Struct.default(); |
72 | | - |
73 | | - 0 |
74 | 64 | } |
75 | | - |
76 | | -//~ MONO_ITEM drop-glue i8 |
0 commit comments