@@ -162,7 +162,9 @@ macro_rules! define_dep_nodes {
162
162
}
163
163
}
164
164
165
- #[ inline]
165
+ // FIXME: Make `is_anon`, `is_input`, `is_eval_always` and `has_params` properties
166
+ // of queries
167
+ #[ inline( always) ]
166
168
pub fn is_anon( & self ) -> bool {
167
169
match * self {
168
170
$(
@@ -171,16 +173,20 @@ macro_rules! define_dep_nodes {
171
173
}
172
174
}
173
175
174
- #[ inline]
175
- pub fn is_input ( & self ) -> bool {
176
+ #[ inline( always ) ]
177
+ pub fn is_input_inlined ( & self ) -> bool {
176
178
match * self {
177
179
$(
178
180
DepKind :: $variant => { contains_input_attr!( $( $attr) ,* ) }
179
181
) *
180
182
}
181
183
}
182
184
183
- #[ inline]
185
+ pub fn is_input( & self ) -> bool {
186
+ self . is_input_inlined( )
187
+ }
188
+
189
+ #[ inline( always) ]
184
190
pub fn is_eval_always( & self ) -> bool {
185
191
match * self {
186
192
$(
@@ -190,8 +196,8 @@ macro_rules! define_dep_nodes {
190
196
}
191
197
192
198
#[ allow( unreachable_code) ]
193
- #[ inline]
194
- pub fn has_params ( & self ) -> bool {
199
+ #[ inline( always ) ]
200
+ pub fn has_params_inlined ( & self ) -> bool {
195
201
match * self {
196
202
$(
197
203
DepKind :: $variant => {
@@ -212,6 +218,10 @@ macro_rules! define_dep_nodes {
212
218
) *
213
219
}
214
220
}
221
+
222
+ pub fn has_params( & self ) -> bool {
223
+ self . has_params_inlined( )
224
+ }
215
225
}
216
226
217
227
pub enum DepConstructor <$tcx> {
@@ -230,7 +240,8 @@ macro_rules! define_dep_nodes {
230
240
231
241
impl DepNode {
232
242
#[ allow( unreachable_code, non_snake_case) ]
233
- pub fn new<' a, ' gcx, ' tcx>( tcx: TyCtxt <' a, ' gcx, ' tcx>,
243
+ #[ inline( always) ]
244
+ pub fn new_inlined<' a, ' gcx, ' tcx>( tcx: TyCtxt <' a, ' gcx, ' tcx>,
234
245
dep: DepConstructor <' gcx>)
235
246
-> DepNode
236
247
where ' gcx: ' a + ' tcx,
@@ -299,7 +310,7 @@ macro_rules! define_dep_nodes {
299
310
/// Construct a DepNode from the given DepKind and DefPathHash. This
300
311
/// method will assert that the given DepKind actually requires a
301
312
/// single DefId/DefPathHash parameter.
302
- #[ inline]
313
+ #[ inline( always ) ]
303
314
pub fn from_def_path_hash( kind: DepKind ,
304
315
def_path_hash: DefPathHash )
305
316
-> DepNode {
@@ -313,9 +324,9 @@ macro_rules! define_dep_nodes {
313
324
/// Create a new, parameterless DepNode. This method will assert
314
325
/// that the DepNode corresponding to the given DepKind actually
315
326
/// does not require any parameters.
316
- #[ inline]
327
+ #[ inline( always ) ]
317
328
pub fn new_no_params( kind: DepKind ) -> DepNode {
318
- assert!( !kind. has_params ( ) ) ;
329
+ assert!( !kind. has_params_inlined ( ) ) ;
319
330
DepNode {
320
331
kind,
321
332
hash: Fingerprint :: ZERO ,
@@ -418,14 +429,14 @@ impl fmt::Debug for DepNode {
418
429
419
430
420
431
impl DefPathHash {
421
- #[ inline]
432
+ #[ inline( always ) ]
422
433
pub fn to_dep_node ( self , kind : DepKind ) -> DepNode {
423
434
DepNode :: from_def_path_hash ( kind, self )
424
435
}
425
436
}
426
437
427
438
impl DefId {
428
- #[ inline]
439
+ #[ inline( always ) ]
429
440
pub fn to_dep_node ( self , tcx : TyCtxt < ' _ , ' _ , ' _ > , kind : DepKind ) -> DepNode {
430
441
DepNode :: from_def_path_hash ( kind, tcx. def_path_hash ( self ) )
431
442
}
0 commit comments