@@ -162,7 +162,9 @@ macro_rules! define_dep_nodes {
162162 }
163163 }
164164
165- #[ inline]
165+ // FIXME: Make `is_anon`, `is_input`, `is_eval_always` and `has_params` properties
166+ // of queries
167+ #[ inline( always) ]
166168 pub fn is_anon( & self ) -> bool {
167169 match * self {
168170 $(
@@ -171,16 +173,20 @@ macro_rules! define_dep_nodes {
171173 }
172174 }
173175
174- #[ inline]
175- pub fn is_input ( & self ) -> bool {
176+ #[ inline( always ) ]
177+ pub fn is_input_inlined ( & self ) -> bool {
176178 match * self {
177179 $(
178180 DepKind :: $variant => { contains_input_attr!( $( $attr) ,* ) }
179181 ) *
180182 }
181183 }
182184
183- #[ inline]
185+ pub fn is_input( & self ) -> bool {
186+ self . is_input_inlined( )
187+ }
188+
189+ #[ inline( always) ]
184190 pub fn is_eval_always( & self ) -> bool {
185191 match * self {
186192 $(
@@ -190,8 +196,8 @@ macro_rules! define_dep_nodes {
190196 }
191197
192198 #[ allow( unreachable_code) ]
193- #[ inline]
194- pub fn has_params ( & self ) -> bool {
199+ #[ inline( always ) ]
200+ pub fn has_params_inlined ( & self ) -> bool {
195201 match * self {
196202 $(
197203 DepKind :: $variant => {
@@ -212,6 +218,10 @@ macro_rules! define_dep_nodes {
212218 ) *
213219 }
214220 }
221+
222+ pub fn has_params( & self ) -> bool {
223+ self . has_params_inlined( )
224+ }
215225 }
216226
217227 pub enum DepConstructor <$tcx> {
@@ -230,7 +240,8 @@ macro_rules! define_dep_nodes {
230240
231241 impl DepNode {
232242 #[ 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>,
234245 dep: DepConstructor <' gcx>)
235246 -> DepNode
236247 where ' gcx: ' a + ' tcx,
@@ -299,7 +310,7 @@ macro_rules! define_dep_nodes {
299310 /// Construct a DepNode from the given DepKind and DefPathHash. This
300311 /// method will assert that the given DepKind actually requires a
301312 /// single DefId/DefPathHash parameter.
302- #[ inline]
313+ #[ inline( always ) ]
303314 pub fn from_def_path_hash( kind: DepKind ,
304315 def_path_hash: DefPathHash )
305316 -> DepNode {
@@ -313,9 +324,9 @@ macro_rules! define_dep_nodes {
313324 /// Create a new, parameterless DepNode. This method will assert
314325 /// that the DepNode corresponding to the given DepKind actually
315326 /// does not require any parameters.
316- #[ inline]
327+ #[ inline( always ) ]
317328 pub fn new_no_params( kind: DepKind ) -> DepNode {
318- assert!( !kind. has_params ( ) ) ;
329+ assert!( !kind. has_params_inlined ( ) ) ;
319330 DepNode {
320331 kind,
321332 hash: Fingerprint :: ZERO ,
@@ -418,14 +429,14 @@ impl fmt::Debug for DepNode {
418429
419430
420431impl DefPathHash {
421- #[ inline]
432+ #[ inline( always ) ]
422433 pub fn to_dep_node ( self , kind : DepKind ) -> DepNode {
423434 DepNode :: from_def_path_hash ( kind, self )
424435 }
425436}
426437
427438impl DefId {
428- #[ inline]
439+ #[ inline( always ) ]
429440 pub fn to_dep_node ( self , tcx : TyCtxt < ' _ , ' _ , ' _ > , kind : DepKind ) -> DepNode {
430441 DepNode :: from_def_path_hash ( kind, tcx. def_path_hash ( self ) )
431442 }
0 commit comments