@@ -411,7 +411,8 @@ where
411411 // get evaluated first, and re-feed the query.
412412 if let Some ( ( cached_result, _) ) = cache. lookup ( & key) {
413413 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)
415416 ) ;
416417 }
417418 }
@@ -582,6 +583,7 @@ where
582583 & result,
583584 prev_dep_node_index,
584585 query. hash_result ( ) ,
586+ query. format_value ( ) ,
585587 ) ;
586588 }
587589
@@ -627,19 +629,21 @@ where
627629 & result,
628630 prev_dep_node_index,
629631 query. hash_result ( ) ,
632+ query. format_value ( ) ,
630633 ) ;
631634
632635 Some ( ( result, dep_node_index) )
633636}
634637
635638#[ 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 > (
638641 tcx : Tcx ,
639642 dep_graph_data : & DepGraphData < Tcx :: DepKind > ,
640643 result : & V ,
641644 prev_index : SerializedDepNodeIndex ,
642645 hash_result : Option < fn ( & mut StableHashingContext < ' _ > , & V ) -> Fingerprint > ,
646+ format_value : fn ( & V ) -> String ,
643647) where
644648 Tcx : DepContext ,
645649{
@@ -654,7 +658,7 @@ pub(crate) fn incremental_verify_ich<Tcx, V: Debug>(
654658 let old_hash = dep_graph_data. prev_fingerprint_of ( prev_index) ;
655659
656660 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) ) ;
658662 }
659663}
660664
@@ -678,7 +682,7 @@ where
678682fn incremental_verify_ich_failed < Tcx > (
679683 tcx : Tcx ,
680684 prev_index : SerializedDepNodeIndex ,
681- result : & dyn Debug ,
685+ result : & dyn Fn ( ) -> String ,
682686) where
683687 Tcx : DepContext ,
684688{
@@ -708,7 +712,7 @@ fn incremental_verify_ich_failed<Tcx>(
708712 run_cmd,
709713 dep_node : format ! ( "{dep_node:?}" ) ,
710714 } ) ;
711- panic ! ( "Found unstable fingerprints for {dep_node:?}: {result:?}" ) ;
715+ panic ! ( "Found unstable fingerprints for {dep_node:?}: {}" , result ( ) ) ;
712716 }
713717
714718 INSIDE_VERIFY_PANIC . with ( |in_panic| in_panic. set ( old_in_panic) ) ;
0 commit comments