File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
compiler/rustc_query_system/src/query Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -518,9 +518,22 @@ where
518518 prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
519519
520520 if let Some ( result) = result {
521+ let prev_fingerprint = tcx
522+ . dep_context ( )
523+ . dep_graph ( )
524+ . prev_fingerprint_of ( dep_node)
525+ . unwrap_or ( Fingerprint :: ZERO ) ;
521526 // If `-Zincremental-verify-ich` is specified, re-hash results from
522527 // the cache and make sure that they have the expected fingerprint.
523- if unlikely ! ( tcx. dep_context( ) . sess( ) . opts. debugging_opts. incremental_verify_ich) {
528+ //
529+ // If not, we still seek to verify a subset of fingerprints loaded
530+ // from disk. Re-hashing results is fairly expensive, so we can't
531+ // currently afford to verify every hash. This subset should still
532+ // give us some coverage of potential bugs though.
533+ let try_verify = prev_fingerprint. as_value ( ) . 1 % 32 == 0 ;
534+ if unlikely ! (
535+ try_verify || tcx. dep_context( ) . sess( ) . opts. debugging_opts. incremental_verify_ich
536+ ) {
524537 incremental_verify_ich ( * tcx. dep_context ( ) , & result, dep_node, query) ;
525538 }
526539
You can’t perform that action at this time.
0 commit comments