@@ -641,7 +641,7 @@ pub(crate) fn incremental_verify_ich<Tcx, V: Debug>(
641641 Tcx : DepContext ,
642642{
643643 if !dep_graph_data. is_index_green ( prev_index) {
644- incremental_verify_ich_not_green :: < Tcx > ( prev_index)
644+ incremental_verify_ich_not_green ( tcx , prev_index)
645645 }
646646
647647 let new_hash = hash_result. map_or ( Fingerprint :: ZERO , |f| {
@@ -651,31 +651,32 @@ pub(crate) fn incremental_verify_ich<Tcx, V: Debug>(
651651 let old_hash = dep_graph_data. prev_fingerprint_of ( prev_index) ;
652652
653653 if new_hash != old_hash {
654- incremental_verify_ich_failed :: < Tcx > ( prev_index, result) ;
654+ incremental_verify_ich_failed ( tcx , prev_index, result) ;
655655 }
656656}
657657
658658#[ cold]
659659#[ inline( never) ]
660- fn incremental_verify_ich_not_green < Tcx > ( prev_index : SerializedDepNodeIndex )
660+ fn incremental_verify_ich_not_green < Tcx > ( tcx : Tcx , prev_index : SerializedDepNodeIndex )
661661where
662662 Tcx : DepContext ,
663663{
664- Tcx :: with_context ( |tcx| {
665- panic ! (
666- "fingerprint for green query instance not loaded from cache: {:?}" ,
667- tcx. dep_graph( ) . data( ) . unwrap( ) . prev_node_of( prev_index)
668- )
669- } )
664+ panic ! (
665+ "fingerprint for green query instance not loaded from cache: {:?}" ,
666+ tcx. dep_graph( ) . data( ) . unwrap( ) . prev_node_of( prev_index)
667+ )
670668}
671669
672670// Note that this is marked #[cold] and intentionally takes `dyn Debug` for `result`,
673671// as we want to avoid generating a bunch of different implementations for LLVM to
674672// chew on (and filling up the final binary, too).
675673#[ cold]
676674#[ inline( never) ]
677- fn incremental_verify_ich_failed < Tcx > ( prev_index : SerializedDepNodeIndex , result : & dyn Debug )
678- where
675+ fn incremental_verify_ich_failed < Tcx > (
676+ tcx : Tcx ,
677+ prev_index : SerializedDepNodeIndex ,
678+ result : & dyn Debug ,
679+ ) where
679680 Tcx : DepContext ,
680681{
681682 // When we emit an error message and panic, we try to debug-print the `DepNode`
@@ -690,25 +691,23 @@ where
690691
691692 let old_in_panic = INSIDE_VERIFY_PANIC . with ( |in_panic| in_panic. replace ( true ) ) ;
692693
693- Tcx :: with_context ( |tcx| {
694- if old_in_panic {
695- tcx. sess ( ) . emit_err ( crate :: error:: Reentrant ) ;
694+ if old_in_panic {
695+ tcx. sess ( ) . emit_err ( crate :: error:: Reentrant ) ;
696+ } else {
697+ let run_cmd = if let Some ( crate_name) = & tcx. sess ( ) . opts . crate_name {
698+ format ! ( "`cargo clean -p {crate_name}` or `cargo clean`" )
696699 } else {
697- let run_cmd = if let Some ( crate_name) = & tcx. sess ( ) . opts . crate_name {
698- format ! ( "`cargo clean -p {crate_name}` or `cargo clean`" )
699- } else {
700- "`cargo clean`" . to_string ( )
701- } ;
700+ "`cargo clean`" . to_string ( )
701+ } ;
702702
703- let dep_node = tcx. dep_graph ( ) . data ( ) . unwrap ( ) . prev_node_of ( prev_index) ;
703+ let dep_node = tcx. dep_graph ( ) . data ( ) . unwrap ( ) . prev_node_of ( prev_index) ;
704704
705- let dep_node = tcx. sess ( ) . emit_err ( crate :: error:: IncrementCompilation {
706- run_cmd,
707- dep_node : format ! ( "{dep_node:?}" ) ,
708- } ) ;
709- panic ! ( "Found unstable fingerprints for {dep_node:?}: {result:?}" ) ;
710- }
711- } ) ;
705+ let dep_node = tcx. sess ( ) . emit_err ( crate :: error:: IncrementCompilation {
706+ run_cmd,
707+ dep_node : format ! ( "{dep_node:?}" ) ,
708+ } ) ;
709+ panic ! ( "Found unstable fingerprints for {dep_node:?}: {result:?}" ) ;
710+ }
712711
713712 INSIDE_VERIFY_PANIC . with ( |in_panic| in_panic. set ( old_in_panic) ) ;
714713}
0 commit comments