Skip to content

Commit d4a9c1a

Browse files
committed
rdr-perf: skip query calls when public api hashing is disabled
1 parent 91e5ab8 commit d4a9c1a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
610610
// an ordered hash of all local defids encapsulates all information contained in a reverse
611611
// mapping as well.
612612
let mut hasher = PublicApiHasher::default();
613-
hasher.digest_iter(self.tcx.iter_local_def_id(), hcx);
613+
if hcx.enabled() {
614+
hasher.digest_iter(self.tcx.iter_local_def_id(), hcx);
615+
}
614616
Hashed { hash: hasher.finish(hcx), value }
615617
}
616618

@@ -793,7 +795,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
793795
let id = self.interpret_allocs[idx];
794796
let pos = self.position() as u64;
795797
interpret_alloc_index.push(pos);
796-
hasher.digest(tcx.global_alloc(id), hcx);
798+
if hcx.enabled() {
799+
hasher.digest(tcx.global_alloc(id), hcx);
800+
}
797801
interpret::specialized_encode_alloc_id(self, tcx, id);
798802
}
799803
n = new_n;

0 commit comments

Comments
 (0)