@@ -570,6 +570,8 @@ macro_rules! define_feedable {
570
570
let value = restore:: <$V>( erased) ;
571
571
let cache = & tcx. query_system. caches. $name;
572
572
573
+ let name: & ' static str = stringify!( $name) ;
574
+ let dep_kind: dep_graph:: DepKind = dep_graph:: dep_kinds:: $name;
573
575
let hasher: Option <fn ( & mut StableHashingContext <' _>, & _) -> _> = hash_result!( [ $( $modifiers) * ] ) ;
574
576
match try_get_cached( tcx, cache, & key) {
575
577
Some ( old) => {
@@ -583,28 +585,27 @@ macro_rules! define_feedable {
583
585
// results is tainted by errors. In this case, delay a bug to
584
586
// ensure compilation is doomed, and keep the `old` value.
585
587
tcx. dcx( ) . delayed_bug( format!(
586
- "Trying to feed an already recorded value for query {} key={key:?}:\n \
588
+ "Trying to feed an already recorded value for query {name } key={key:?}:\n \
587
589
old value: {old:?}\n new value: {value:?}",
588
- stringify!( $name) ,
589
590
) ) ;
590
591
}
591
592
} else {
592
593
// The query is `no_hash`, so we have no way to perform a sanity check.
593
594
// If feeding the same value multiple times needs to be supported,
594
595
// the query should not be marked `no_hash`.
595
596
bug!(
596
- "Trying to feed an already recorded value for query {} key={key:?}:\n old value: {old:?} \n new value: {value:?}" ,
597
- stringify! ( $name ) ,
597
+ "Trying to feed an already recorded value for query {name } key={key:?}:\n \
598
+ old value: {old:?} \n new value: {value:?}" ,
598
599
)
599
600
}
600
601
}
601
602
None => {
602
- let dep_node = dep_graph:: DepNode :: construct( tcx, dep_graph :: dep_kinds :: $name , & key) ;
603
+ let dep_node = dep_graph:: DepNode :: construct( tcx, dep_kind , & key) ;
603
604
let dep_node_index = tcx. dep_graph. with_feed_task(
604
605
dep_node,
605
606
tcx,
606
607
& value,
607
- hash_result! ( [ $ ( $modifiers ) * ] ) ,
608
+ hasher ,
608
609
) ;
609
610
cache. complete( key, erased, dep_node_index) ;
610
611
}
0 commit comments