Skip to content

Commit fb09bd5

Browse files
authored
Rollup merge of rust-lang#138750 - oli-obk:decouple-hir-queries, r=fee1-dead
Make `crate_hash` not iterate over `hir_crate` owners anymore cc rust-lang#95004 One more direct usage of hir::Crate removed
2 parents 14f6216 + 485c14f commit fb09bd5

File tree

1 file changed

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

1 file changed

+5
-6
lines changed

compiler/rustc_middle/src/hir/map.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1176,15 +1176,14 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, _: LocalCrate) -> Svh {
11761176
debugger_visualizers.hash_stable(&mut hcx, &mut stable_hasher);
11771177
if tcx.sess.opts.incremental.is_some() {
11781178
let definitions = tcx.untracked().definitions.freeze();
1179-
let mut owner_spans: Vec<_> = krate
1180-
.owners
1181-
.iter_enumerated()
1182-
.filter_map(|(def_id, info)| {
1183-
let _ = info.as_owner()?;
1179+
let mut owner_spans: Vec<_> = tcx
1180+
.hir_crate_items(())
1181+
.definitions()
1182+
.map(|def_id| {
11841183
let def_path_hash = definitions.def_path_hash(def_id);
11851184
let span = tcx.source_span(def_id);
11861185
debug_assert_eq!(span.parent(), None);
1187-
Some((def_path_hash, span))
1186+
(def_path_hash, span)
11881187
})
11891188
.collect();
11901189
owner_spans.sort_unstable_by_key(|bn| bn.0);

0 commit comments

Comments
 (0)