From eb5a4000ff3dd12c13372fd88d0c4b9b750f4b15 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 24 Mar 2026 15:07:04 +1100 Subject: [PATCH] Don't use disk-cache for query `def_kind` From what I can tell, the `def_kind` query has no local provider, and is always given its value via query feeding, usually from `TyCtxt::create_def`. If that's the case, there should never be any opportunity for a previous value to be loaded from disk-cache, so serializing the current-session values is a waste of time. --- compiler/rustc_middle/src/queries.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/queries.rs b/compiler/rustc_middle/src/queries.rs index 179998c2ee24c..35e33fd2d5457 100644 --- a/compiler/rustc_middle/src/queries.rs +++ b/compiler/rustc_middle/src/queries.rs @@ -1436,8 +1436,10 @@ rustc_queries! { query def_kind(def_id: DefId) -> DefKind { desc { "looking up definition kind of `{}`", tcx.def_path_str(def_id) } - cache_on_disk separate_provide_extern + // This query has no local provider. For defs in the current crate, + // its value is always set by feeding when the `DefId` is created, + // usually in `TyCtxt::create_def`. feedable }