about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-22 11:59:19 +0100
committerGitHub <noreply@github.com>2025-03-22 11:59:19 +0100
commitfb09bd52a8b5a063f36aa840a42e7905a4d7ace7 (patch)
tree3c5dff13fb17e5306ec1f8ccdb418232aa70ac22
parent14f6216cf40fba8306dd8468198c58758d33d925 (diff)
parent485c14f373c4bd2365283375ceba5fa105451dbe (diff)
downloadrust-fb09bd52a8b5a063f36aa840a42e7905a4d7ace7.tar.gz
rust-fb09bd52a8b5a063f36aa840a42e7905a4d7ace7.zip
Rollup merge of #138750 - oli-obk:decouple-hir-queries, r=fee1-dead
Make `crate_hash` not iterate over `hir_crate` owners anymore

cc https://github.com/rust-lang/rust/issues/95004

One more direct usage of hir::Crate removed
-rw-r--r--compiler/rustc_middle/src/hir/map.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/hir/map.rs b/compiler/rustc_middle/src/hir/map.rs
index f17efab81ec..52f155a16b8 100644
--- a/compiler/rustc_middle/src/hir/map.rs
+++ b/compiler/rustc_middle/src/hir/map.rs
@@ -1176,15 +1176,14 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, _: LocalCrate) -> Svh {
         debugger_visualizers.hash_stable(&mut hcx, &mut stable_hasher);
         if tcx.sess.opts.incremental.is_some() {
             let definitions = tcx.untracked().definitions.freeze();
-            let mut owner_spans: Vec<_> = krate
-                .owners
-                .iter_enumerated()
-                .filter_map(|(def_id, info)| {
-                    let _ = info.as_owner()?;
+            let mut owner_spans: Vec<_> = tcx
+                .hir_crate_items(())
+                .definitions()
+                .map(|def_id| {
                     let def_path_hash = definitions.def_path_hash(def_id);
                     let span = tcx.source_span(def_id);
                     debug_assert_eq!(span.parent(), None);
-                    Some((def_path_hash, span))
+                    (def_path_hash, span)
                 })
                 .collect();
             owner_spans.sort_unstable_by_key(|bn| bn.0);