@@ -19,18 +19,18 @@ impl QueryKeyStringCache {
19
19
}
20
20
}
21
21
22
- struct QueryKeyStringBuilder < ' p , ' c , ' tcx > {
22
+ struct QueryKeyStringBuilder < ' p , ' tcx > {
23
23
profiler : & ' p SelfProfiler ,
24
24
tcx : TyCtxt < ' tcx > ,
25
- string_cache : & ' c mut QueryKeyStringCache ,
25
+ string_cache : & ' p mut QueryKeyStringCache ,
26
26
}
27
27
28
- impl < ' p , ' c , ' tcx > QueryKeyStringBuilder < ' p , ' c , ' tcx > {
28
+ impl < ' p , ' tcx > QueryKeyStringBuilder < ' p , ' tcx > {
29
29
fn new (
30
30
profiler : & ' p SelfProfiler ,
31
31
tcx : TyCtxt < ' tcx > ,
32
- string_cache : & ' c mut QueryKeyStringCache ,
33
- ) -> QueryKeyStringBuilder < ' p , ' c , ' tcx > {
32
+ string_cache : & ' p mut QueryKeyStringCache ,
33
+ ) -> QueryKeyStringBuilder < ' p , ' tcx > {
34
34
QueryKeyStringBuilder { profiler, tcx, string_cache }
35
35
}
36
36
@@ -99,7 +99,7 @@ impl<'p, 'c, 'tcx> QueryKeyStringBuilder<'p, 'c, 'tcx> {
99
99
}
100
100
101
101
trait IntoSelfProfilingString {
102
- fn to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ) -> StringId ;
102
+ fn to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId ;
103
103
}
104
104
105
105
// The default implementation of `IntoSelfProfilingString` just uses `Debug`
@@ -109,68 +109,50 @@ trait IntoSelfProfilingString {
109
109
impl < T : Debug > IntoSelfProfilingString for T {
110
110
default fn to_self_profile_string (
111
111
& self ,
112
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
112
+ builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ,
113
113
) -> StringId {
114
114
let s = format ! ( "{:?}" , self ) ;
115
115
builder. profiler . alloc_string ( & s[ ..] )
116
116
}
117
117
}
118
118
119
119
impl < T : SpecIntoSelfProfilingString > IntoSelfProfilingString for T {
120
- fn to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ) -> StringId {
120
+ fn to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
121
121
self . spec_to_self_profile_string ( builder)
122
122
}
123
123
}
124
124
125
125
#[ rustc_specialization_trait]
126
126
trait SpecIntoSelfProfilingString : Debug {
127
- fn spec_to_self_profile_string (
128
- & self ,
129
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
130
- ) -> StringId ;
127
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId ;
131
128
}
132
129
133
130
impl SpecIntoSelfProfilingString for DefId {
134
- fn spec_to_self_profile_string (
135
- & self ,
136
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
137
- ) -> StringId {
131
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
138
132
builder. def_id_to_string_id ( * self )
139
133
}
140
134
}
141
135
142
136
impl SpecIntoSelfProfilingString for CrateNum {
143
- fn spec_to_self_profile_string (
144
- & self ,
145
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
146
- ) -> StringId {
137
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
147
138
builder. def_id_to_string_id ( self . as_def_id ( ) )
148
139
}
149
140
}
150
141
151
142
impl SpecIntoSelfProfilingString for DefIndex {
152
- fn spec_to_self_profile_string (
153
- & self ,
154
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
155
- ) -> StringId {
143
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
156
144
builder. def_id_to_string_id ( DefId { krate : LOCAL_CRATE , index : * self } )
157
145
}
158
146
}
159
147
160
148
impl SpecIntoSelfProfilingString for LocalDefId {
161
- fn spec_to_self_profile_string (
162
- & self ,
163
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
164
- ) -> StringId {
149
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
165
150
builder. def_id_to_string_id ( DefId { krate : LOCAL_CRATE , index : self . local_def_index } )
166
151
}
167
152
}
168
153
169
154
impl < T : SpecIntoSelfProfilingString > SpecIntoSelfProfilingString for WithOptConstParam < T > {
170
- fn spec_to_self_profile_string (
171
- & self ,
172
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
173
- ) -> StringId {
155
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
174
156
// We print `WithOptConstParam` values as tuples to make them shorter
175
157
// and more readable, without losing information:
176
158
//
@@ -205,10 +187,7 @@ where
205
187
T0 : SpecIntoSelfProfilingString ,
206
188
T1 : SpecIntoSelfProfilingString ,
207
189
{
208
- fn spec_to_self_profile_string (
209
- & self ,
210
- builder : & mut QueryKeyStringBuilder < ' _ , ' _ , ' _ > ,
211
- ) -> StringId {
190
+ fn spec_to_self_profile_string ( & self , builder : & mut QueryKeyStringBuilder < ' _ , ' _ > ) -> StringId {
212
191
let val0 = self . 0 . to_self_profile_string ( builder) ;
213
192
let val1 = self . 1 . to_self_profile_string ( builder) ;
214
193
0 commit comments