Skip to content

Commit 99fdeda

Browse files
committed
Make crate_hash not iterate over hir_crate owners anymore
1 parent 360569a commit 99fdeda

File tree

1 file changed

+6
-4
lines changed
  • compiler/rustc_middle/src/hir

1 file changed

+6
-4
lines changed

compiler/rustc_middle/src/hir/map.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1173,10 +1173,12 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, _: LocalCrate) -> Svh {
11731173
debugger_visualizers.hash_stable(&mut hcx, &mut stable_hasher);
11741174
if tcx.sess.opts.incremental.is_some() {
11751175
let definitions = tcx.untracked().definitions.freeze();
1176-
let mut owner_spans: Vec<_> = krate
1177-
.owners
1178-
.iter_enumerated()
1179-
.filter_map(|(def_id, info)| {
1176+
let mut owner_spans: Vec<_> = definitions
1177+
.def_path_table()
1178+
.def_keys()
1179+
.filter_map(|local_def_index| {
1180+
let def_id = LocalDefId { local_def_index };
1181+
let info = tcx.hir_owner(def_id);
11801182
let _ = info.as_owner()?;
11811183
let def_path_hash = definitions.def_path_hash(def_id);
11821184
let span = tcx.source_span(def_id);

0 commit comments

Comments
 (0)