summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-11-24 00:49:02 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-11-25 14:49:43 +0300
commit2c233863443201117b711bab0e0bf6966cd221f3 (patch)
tree98f4e00b268530a5d9adb4a8e1a9f400ab960c44 /compiler/rustc_query_impl/src
parentfad6bb80fa89100e839ea7cbb4e9999188c0ac0d (diff)
downloadrust-2c233863443201117b711bab0e0bf6966cd221f3.tar.gz
rust-2c233863443201117b711bab0e0bf6966cd221f3.zip
rustc: Make `def_kind` mandatory for all `DefId`s
Diffstat (limited to 'compiler/rustc_query_impl/src')
-rw-r--r--compiler/rustc_query_impl/src/plumbing.rs4
1 files changed, 2 insertions, 2 deletions
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| {