Skip to content

Commit c3276c6

Browse files
committed
Hash visibilities in crate_hash.
1 parent 9861bc8 commit c3276c6

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_middle/src/hir/map

1 file changed

+4
-0
lines changed

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,10 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh {
11211121
}
11221122
tcx.sess.opts.dep_tracking_hash(true).hash_stable(&mut hcx, &mut stable_hasher);
11231123
tcx.sess.local_stable_crate_id().hash_stable(&mut hcx, &mut stable_hasher);
1124+
// Hash visibility information since it does not appear in HIR.
1125+
let resolutions = tcx.resolutions(());
1126+
resolutions.visibilities.hash_stable(&mut hcx, &mut stable_hasher);
1127+
resolutions.has_pub_restricted.hash_stable(&mut hcx, &mut stable_hasher);
11241128

11251129
let crate_hash: Fingerprint = stable_hasher.finish();
11261130
Svh::new(crate_hash.to_smaller_hash())

0 commit comments

Comments
 (0)