Make some simple queries no longer cache on disk

This commit is contained in:
Michael Goulet 2023-04-30 19:59:30 +00:00
parent 831c9298c8
commit 37f7db87b0

View file

@ -617,13 +617,11 @@ rustc_queries! {
/// `is_const_fn` function. Consider using `is_const_fn` or `is_const_fn_raw` instead. /// `is_const_fn` function. Consider using `is_const_fn` or `is_const_fn_raw` instead.
query constness(key: DefId) -> hir::Constness { query constness(key: DefId) -> hir::Constness {
desc { |tcx| "checking if item is const: `{}`", tcx.def_path_str(key) } desc { |tcx| "checking if item is const: `{}`", tcx.def_path_str(key) }
cache_on_disk_if { key.is_local() }
separate_provide_extern separate_provide_extern
} }
query asyncness(key: DefId) -> hir::IsAsync { query asyncness(key: DefId) -> hir::IsAsync {
desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) } desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) }
cache_on_disk_if { key.is_local() }
separate_provide_extern separate_provide_extern
} }
@ -641,14 +639,12 @@ rustc_queries! {
/// Returns `true` if this is a foreign item (i.e., linked via `extern { ... }`). /// Returns `true` if this is a foreign item (i.e., linked via `extern { ... }`).
query is_foreign_item(key: DefId) -> bool { query is_foreign_item(key: DefId) -> bool {
desc { |tcx| "checking if `{}` is a foreign item", tcx.def_path_str(key) } desc { |tcx| "checking if `{}` is a foreign item", tcx.def_path_str(key) }
cache_on_disk_if { key.is_local() }
separate_provide_extern separate_provide_extern
} }
/// Returns `Some(generator_kind)` if the node pointed to by `def_id` is a generator. /// Returns `Some(generator_kind)` if the node pointed to by `def_id` is a generator.
query generator_kind(def_id: DefId) -> Option<hir::GeneratorKind> { query generator_kind(def_id: DefId) -> Option<hir::GeneratorKind> {
desc { |tcx| "looking up generator kind of `{}`", tcx.def_path_str(def_id) } desc { |tcx| "looking up generator kind of `{}`", tcx.def_path_str(def_id) }
cache_on_disk_if { def_id.is_local() }
separate_provide_extern separate_provide_extern
} }
@ -747,7 +743,6 @@ rustc_queries! {
} }
query impl_polarity(impl_id: DefId) -> ty::ImplPolarity { query impl_polarity(impl_id: DefId) -> ty::ImplPolarity {
desc { |tcx| "computing implementation polarity of `{}`", tcx.def_path_str(impl_id) } desc { |tcx| "computing implementation polarity of `{}`", tcx.def_path_str(impl_id) }
cache_on_disk_if { impl_id.is_local() }
separate_provide_extern separate_provide_extern
} }
@ -879,7 +874,6 @@ rustc_queries! {
} }
query diagnostic_only_typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> { query diagnostic_only_typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) } desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
cache_on_disk_if { true }
} }
query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> { query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
@ -1144,7 +1138,6 @@ rustc_queries! {
query fn_arg_names(def_id: DefId) -> &'tcx [rustc_span::symbol::Ident] { query fn_arg_names(def_id: DefId) -> &'tcx [rustc_span::symbol::Ident] {
desc { |tcx| "looking up function parameter names for `{}`", tcx.def_path_str(def_id) } desc { |tcx| "looking up function parameter names for `{}`", tcx.def_path_str(def_id) }
cache_on_disk_if { def_id.is_local() }
separate_provide_extern separate_provide_extern
} }
/// Gets the rendered value of the specified constant or associated constant. /// Gets the rendered value of the specified constant or associated constant.
@ -1152,12 +1145,10 @@ rustc_queries! {
query rendered_const(def_id: DefId) -> &'tcx String { query rendered_const(def_id: DefId) -> &'tcx String {
arena_cache arena_cache
desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) } desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) }
cache_on_disk_if { def_id.is_local() }
separate_provide_extern separate_provide_extern
} }
query impl_parent(def_id: DefId) -> Option<DefId> { query impl_parent(def_id: DefId) -> Option<DefId> {
desc { |tcx| "computing specialization parent impl of `{}`", tcx.def_path_str(def_id) } desc { |tcx| "computing specialization parent impl of `{}`", tcx.def_path_str(def_id) }
cache_on_disk_if { def_id.is_local() }
separate_provide_extern separate_provide_extern
} }
@ -1410,7 +1401,6 @@ rustc_queries! {
query impl_defaultness(def_id: DefId) -> hir::Defaultness { query impl_defaultness(def_id: DefId) -> hir::Defaultness {
desc { |tcx| "looking up whether `{}` is a default impl", tcx.def_path_str(def_id) } desc { |tcx| "looking up whether `{}` is a default impl", tcx.def_path_str(def_id) }
cache_on_disk_if { def_id.is_local() }
separate_provide_extern separate_provide_extern
feedable feedable
} }