Skip to content

Commit b5e35c8

Browse files
committed
Remove eval_always for HIR queries.
They depend on `hir_crate` and `index_hir`.
1 parent 88b1d8a commit b5e35c8

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

compiler/rustc_middle/src/hir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub fn provide(providers: &mut Providers) {
137137
providers.hir_crate = |tcx, ()| tcx.untracked_crate;
138138
providers.index_hir = map::index_hir;
139139
providers.crate_hash = map::crate_hash;
140-
providers.hir_module_items = |tcx, id| &tcx.untracked_crate.modules[&id];
140+
providers.hir_module_items = |tcx, id| &tcx.hir_crate(()).modules[&id];
141141
providers.hir_owner = |tcx, id| {
142142
let owner = tcx.index_hir(id)?;
143143
let node = owner.nodes.nodes[ItemLocalId::new(0)].as_ref().unwrap().node;
@@ -158,7 +158,7 @@ pub fn provide(providers: &mut Providers) {
158158
});
159159
parent
160160
};
161-
providers.hir_attrs = |tcx, id| AttributeMap { map: &tcx.untracked_crate.attrs, prefix: id };
161+
providers.hir_attrs = |tcx, id| AttributeMap { map: &tcx.hir_crate(()).attrs, prefix: id };
162162
providers.source_span = |tcx, def_id| tcx.resolutions(()).definitions.def_span(def_id);
163163
providers.def_span = |tcx, def_id| tcx.hir().span_if_local(def_id).unwrap_or(DUMMY_SP);
164164
providers.fn_arg_names = |tcx, id| {

compiler/rustc_middle/src/query/mod.rs

-11
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ rustc_queries! {
5252
/// This can be conveniently accessed by `tcx.hir().visit_item_likes_in_module`.
5353
/// Avoid calling this query directly.
5454
query hir_module_items(key: LocalDefId) -> &'tcx hir::ModuleItems {
55-
eval_always
5655
desc { |tcx| "HIR module items in `{}`", tcx.def_path_str(key.to_def_id()) }
5756
}
5857

@@ -61,7 +60,6 @@ rustc_queries! {
6160
/// This can be conveniently accessed by methods on `tcx.hir()`.
6261
/// Avoid calling this query directly.
6362
query hir_owner(key: LocalDefId) -> Option<crate::hir::Owner<'tcx>> {
64-
eval_always
6563
desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) }
6664
}
6765

@@ -70,7 +68,6 @@ rustc_queries! {
7068
/// This can be conveniently accessed by methods on `tcx.hir()`.
7169
/// Avoid calling this query directly.
7270
query hir_owner_parent(key: LocalDefId) -> hir::HirId {
73-
eval_always
7471
desc { |tcx| "HIR parent of `{}`", tcx.def_path_str(key.to_def_id()) }
7572
}
7673

@@ -79,7 +76,6 @@ rustc_queries! {
7976
/// This can be conveniently accessed by methods on `tcx.hir()`.
8077
/// Avoid calling this query directly.
8178
query hir_owner_nodes(key: LocalDefId) -> Option<&'tcx crate::hir::OwnerNodes<'tcx>> {
82-
eval_always
8379
desc { |tcx| "HIR owner items in `{}`", tcx.def_path_str(key.to_def_id()) }
8480
}
8581

@@ -88,7 +84,6 @@ rustc_queries! {
8884
/// This can be conveniently accessed by methods on `tcx.hir()`.
8985
/// Avoid calling this query directly.
9086
query hir_attrs(key: LocalDefId) -> rustc_middle::hir::AttributeMap<'tcx> {
91-
eval_always
9287
desc { |tcx| "HIR owner attributes in `{}`", tcx.def_path_str(key.to_def_id()) }
9388
}
9489

@@ -940,12 +935,6 @@ rustc_queries! {
940935

941936
query def_span(def_id: DefId) -> Span {
942937
desc { |tcx| "looking up span for `{}`", tcx.def_path_str(def_id) }
943-
// FIXME(mw): DefSpans are not really inputs since they are derived from
944-
// HIR. But at the moment HIR hashing still contains some hacks that allow
945-
// to make type debuginfo to be source location independent. Declaring
946-
// DefSpan an input makes sure that changes to these are always detected
947-
// regardless of HIR hashing.
948-
eval_always
949938
}
950939

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

0 commit comments

Comments
 (0)