@@ -411,7 +411,8 @@ where
411
411
// get evaluated first, and re-feed the query.
412
412
if let Some ( ( cached_result, _) ) = cache. lookup ( & key) {
413
413
panic ! (
414
- "fed query later has its value computed. The already cached value: {cached_result:?}"
414
+ "fed query later has its value computed. The already cached value: {}" ,
415
+ ( query. format_value( ) ) ( & cached_result)
415
416
) ;
416
417
}
417
418
}
@@ -582,6 +583,7 @@ where
582
583
& result,
583
584
prev_dep_node_index,
584
585
query. hash_result ( ) ,
586
+ query. format_value ( ) ,
585
587
) ;
586
588
}
587
589
@@ -627,19 +629,21 @@ where
627
629
& result,
628
630
prev_dep_node_index,
629
631
query. hash_result ( ) ,
632
+ query. format_value ( ) ,
630
633
) ;
631
634
632
635
Some ( ( result, dep_node_index) )
633
636
}
634
637
635
638
#[ inline]
636
- #[ instrument( skip( tcx, dep_graph_data, result, hash_result) , level = "debug" ) ]
637
- pub ( crate ) fn incremental_verify_ich < Tcx , V : Debug > (
639
+ #[ instrument( skip( tcx, dep_graph_data, result, hash_result, format_value ) , level = "debug" ) ]
640
+ pub ( crate ) fn incremental_verify_ich < Tcx , V > (
638
641
tcx : Tcx ,
639
642
dep_graph_data : & DepGraphData < Tcx :: DepKind > ,
640
643
result : & V ,
641
644
prev_index : SerializedDepNodeIndex ,
642
645
hash_result : Option < fn ( & mut StableHashingContext < ' _ > , & V ) -> Fingerprint > ,
646
+ format_value : fn ( & V ) -> String ,
643
647
) where
644
648
Tcx : DepContext ,
645
649
{
@@ -654,7 +658,7 @@ pub(crate) fn incremental_verify_ich<Tcx, V: Debug>(
654
658
let old_hash = dep_graph_data. prev_fingerprint_of ( prev_index) ;
655
659
656
660
if new_hash != old_hash {
657
- incremental_verify_ich_failed ( tcx, prev_index, result) ;
661
+ incremental_verify_ich_failed ( tcx, prev_index, & || format_value ( & result) ) ;
658
662
}
659
663
}
660
664
@@ -678,7 +682,7 @@ where
678
682
fn incremental_verify_ich_failed < Tcx > (
679
683
tcx : Tcx ,
680
684
prev_index : SerializedDepNodeIndex ,
681
- result : & dyn Debug ,
685
+ result : & dyn Fn ( ) -> String ,
682
686
) where
683
687
Tcx : DepContext ,
684
688
{
@@ -708,7 +712,7 @@ fn incremental_verify_ich_failed<Tcx>(
708
712
run_cmd,
709
713
dep_node : format ! ( "{dep_node:?}" ) ,
710
714
} ) ;
711
- panic ! ( "Found unstable fingerprints for {dep_node:?}: {result:?}" ) ;
715
+ panic ! ( "Found unstable fingerprints for {dep_node:?}: {}" , result ( ) ) ;
712
716
}
713
717
714
718
INSIDE_VERIFY_PANIC . with ( |in_panic| in_panic. set ( old_in_panic) ) ;
0 commit comments