about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src/keys.rs
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2022-03-15 16:30:30 +0100
committerlcnr <rust@lcnr.de>2022-03-30 11:23:58 +0200
commitbef6f3e895beede5bfd5ba4bb12898615c156d59 (patch)
tree724e0593725707bbff014409e6b495142830315b /compiler/rustc_query_impl/src/keys.rs
parent4558a125b6108f3c080e88d7746e1d422b969bef (diff)
downloadrust-bef6f3e895beede5bfd5ba4bb12898615c156d59.tar.gz
rust-bef6f3e895beede5bfd5ba4bb12898615c156d59.zip
rework implementation for inherent impls for builtin types
Diffstat (limited to 'compiler/rustc_query_impl/src/keys.rs')
-rw-r--r--compiler/rustc_query_impl/src/keys.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs
index 84de31a194d..f1f83a7299c 100644
--- a/compiler/rustc_query_impl/src/keys.rs
+++ b/compiler/rustc_query_impl/src/keys.rs
@@ -141,6 +141,16 @@ impl Key for ty::WithOptConstParam<LocalDefId> {
     }
 }
 
+impl Key for SimplifiedType {
+    #[inline(always)]
+    fn query_crate_is_local(&self) -> bool {
+        true
+    }
+    fn default_span(&self, _: TyCtxt<'_>) -> Span {
+        DUMMY_SP
+    }
+}
+
 impl Key for (DefId, DefId) {
     #[inline(always)]
     fn query_crate_is_local(&self) -> bool {
@@ -215,6 +225,16 @@ impl Key for (CrateNum, DefId) {
     }
 }
 
+impl Key for (CrateNum, SimplifiedType) {
+    #[inline(always)]
+    fn query_crate_is_local(&self) -> bool {
+        self.0 == LOCAL_CRATE
+    }
+    fn default_span(&self, _: TyCtxt<'_>) -> Span {
+        DUMMY_SP
+    }
+}
+
 impl Key for (DefId, SimplifiedType) {
     #[inline(always)]
     fn query_crate_is_local(&self) -> bool {