Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 54c3299

Browse files
committed
Remove eval_always for HIR queries.
They depend on `hir_crate` and `index_hir`.
1 parent 0157cc9 commit 54c3299

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

compiler/rustc_middle/src/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub fn provide(providers: &mut Providers) {
163163
let index = tcx.index_hir(());
164164
index.parenting.get(&id).copied().unwrap_or(CRATE_HIR_ID)
165165
};
166-
providers.hir_attrs = |tcx, id| AttributeMap { map: &tcx.untracked_crate.attrs, prefix: id };
166+
providers.hir_attrs = |tcx, id| AttributeMap { map: &tcx.hir_crate(()).attrs, prefix: id };
167167
providers.source_span = |tcx, def_id| tcx.resolutions(()).definitions.def_span(def_id);
168168
providers.def_span = |tcx, def_id| tcx.hir().span_if_local(def_id).unwrap_or(DUMMY_SP);
169169
providers.fn_arg_names = |tcx, id| {

compiler/rustc_middle/src/query/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ rustc_queries! {
6262
/// This can be conveniently accessed by methods on `tcx.hir()`.
6363
/// Avoid calling this query directly.
6464
query hir_owner(key: LocalDefId) -> Option<crate::hir::Owner<'tcx>> {
65-
eval_always
6665
desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) }
6766
}
6867

@@ -71,7 +70,6 @@ rustc_queries! {
7170
/// This can be conveniently accessed by methods on `tcx.hir()`.
7271
/// Avoid calling this query directly.
7372
query hir_owner_parent(key: LocalDefId) -> hir::HirId {
74-
eval_always
7573
desc { |tcx| "HIR parent of `{}`", tcx.def_path_str(key.to_def_id()) }
7674
}
7775

@@ -80,7 +78,6 @@ rustc_queries! {
8078
/// This can be conveniently accessed by methods on `tcx.hir()`.
8179
/// Avoid calling this query directly.
8280
query hir_owner_nodes(key: LocalDefId) -> Option<&'tcx crate::hir::OwnerNodes<'tcx>> {
83-
eval_always
8481
desc { |tcx| "HIR owner items in `{}`", tcx.def_path_str(key.to_def_id()) }
8582
}
8683

@@ -89,7 +86,6 @@ rustc_queries! {
8986
/// This can be conveniently accessed by methods on `tcx.hir()`.
9087
/// Avoid calling this query directly.
9188
query hir_attrs(key: LocalDefId) -> rustc_middle::hir::AttributeMap<'tcx> {
92-
eval_always
9389
desc { |tcx| "HIR owner attributes in `{}`", tcx.def_path_str(key.to_def_id()) }
9490
}
9591

@@ -933,12 +929,6 @@ rustc_queries! {
933929

934930
query def_span(def_id: DefId) -> Span {
935931
desc { |tcx| "looking up span for `{}`", tcx.def_path_str(def_id) }
936-
// FIXME(mw): DefSpans are not really inputs since they are derived from
937-
// HIR. But at the moment HIR hashing still contains some hacks that allow
938-
// to make type debuginfo to be source location independent. Declaring
939-
// DefSpan an input makes sure that changes to these are always detected
940-
// regardless of HIR hashing.
941-
eval_always
942932
}
943933

944934
query def_ident_span(def_id: DefId) -> Option<Span> {

0 commit comments

Comments
 (0)