From 2c233863443201117b711bab0e0bf6966cd221f3 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 24 Nov 2023 00:49:02 +0300 Subject: rustc: Make `def_kind` mandatory for all `DefId`s --- compiler/rustc_query_impl/src/plumbing.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_query_impl/src') diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index a290bd10bea..9faf63f00e2 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -325,11 +325,11 @@ pub(crate) fn create_query_frame< Some(key.default_span(tcx)) }; let def_id = key.key_as_def_id(); - let def_kind = if kind == dep_graph::dep_kinds::opt_def_kind || with_no_queries() { + let def_kind = if kind == dep_graph::dep_kinds::def_kind || with_no_queries() { // Try to avoid infinite recursion. None } else { - def_id.and_then(|def_id| def_id.as_local()).and_then(|def_id| tcx.opt_def_kind(def_id)) + def_id.and_then(|def_id| def_id.as_local()).map(|def_id| tcx.def_kind(def_id)) }; let hash = || { tcx.with_stable_hashing_context(|mut hcx| { -- cgit 1.4.1-3-g733a5