Skip to content

Commit a368898

Browse files
committed
Auto merge of rust-lang#111028 - compiler-errors:attr-query-no-caching, r=cjgillot
Make some simple queries no longer cache on disk I don't think we need to cache queries with really simple local providers, like loading hir and accessing an attr r? `@ghost`
2 parents 9d795a6 + 37f7db8 commit a368898

File tree

1 file changed

+0
-10
lines changed
  • compiler/rustc_middle/src/query

1 file changed

+0
-10
lines changed

compiler/rustc_middle/src/query/mod.rs

-10
Original file line numberDiff line numberDiff line change
@@ -617,13 +617,11 @@ rustc_queries! {
617617
/// `is_const_fn` function. Consider using `is_const_fn` or `is_const_fn_raw` instead.
618618
query constness(key: DefId) -> hir::Constness {
619619
desc { |tcx| "checking if item is const: `{}`", tcx.def_path_str(key) }
620-
cache_on_disk_if { key.is_local() }
621620
separate_provide_extern
622621
}
623622

624623
query asyncness(key: DefId) -> hir::IsAsync {
625624
desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) }
626-
cache_on_disk_if { key.is_local() }
627625
separate_provide_extern
628626
}
629627

@@ -641,14 +639,12 @@ rustc_queries! {
641639
/// Returns `true` if this is a foreign item (i.e., linked via `extern { ... }`).
642640
query is_foreign_item(key: DefId) -> bool {
643641
desc { |tcx| "checking if `{}` is a foreign item", tcx.def_path_str(key) }
644-
cache_on_disk_if { key.is_local() }
645642
separate_provide_extern
646643
}
647644

648645
/// Returns `Some(generator_kind)` if the node pointed to by `def_id` is a generator.
649646
query generator_kind(def_id: DefId) -> Option<hir::GeneratorKind> {
650647
desc { |tcx| "looking up generator kind of `{}`", tcx.def_path_str(def_id) }
651-
cache_on_disk_if { def_id.is_local() }
652648
separate_provide_extern
653649
}
654650

@@ -747,7 +743,6 @@ rustc_queries! {
747743
}
748744
query impl_polarity(impl_id: DefId) -> ty::ImplPolarity {
749745
desc { |tcx| "computing implementation polarity of `{}`", tcx.def_path_str(impl_id) }
750-
cache_on_disk_if { impl_id.is_local() }
751746
separate_provide_extern
752747
}
753748

@@ -879,7 +874,6 @@ rustc_queries! {
879874
}
880875
query diagnostic_only_typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
881876
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
882-
cache_on_disk_if { true }
883877
}
884878

885879
query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
@@ -1144,20 +1138,17 @@ rustc_queries! {
11441138

11451139
query fn_arg_names(def_id: DefId) -> &'tcx [rustc_span::symbol::Ident] {
11461140
desc { |tcx| "looking up function parameter names for `{}`", tcx.def_path_str(def_id) }
1147-
cache_on_disk_if { def_id.is_local() }
11481141
separate_provide_extern
11491142
}
11501143
/// Gets the rendered value of the specified constant or associated constant.
11511144
/// Used by rustdoc.
11521145
query rendered_const(def_id: DefId) -> &'tcx String {
11531146
arena_cache
11541147
desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) }
1155-
cache_on_disk_if { def_id.is_local() }
11561148
separate_provide_extern
11571149
}
11581150
query impl_parent(def_id: DefId) -> Option<DefId> {
11591151
desc { |tcx| "computing specialization parent impl of `{}`", tcx.def_path_str(def_id) }
1160-
cache_on_disk_if { def_id.is_local() }
11611152
separate_provide_extern
11621153
}
11631154

@@ -1410,7 +1401,6 @@ rustc_queries! {
14101401

14111402
query impl_defaultness(def_id: DefId) -> hir::Defaultness {
14121403
desc { |tcx| "looking up whether `{}` is a default impl", tcx.def_path_str(def_id) }
1413-
cache_on_disk_if { def_id.is_local() }
14141404
separate_provide_extern
14151405
feedable
14161406
}

0 commit comments

Comments
 (0)