From bef6f3e895beede5bfd5ba4bb12898615c156d59 Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 15 Mar 2022 16:30:30 +0100 Subject: rework implementation for inherent impls for builtin types --- compiler/rustc_query_impl/src/keys.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'compiler/rustc_query_impl/src') 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 { } } +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 { -- cgit 1.4.1-3-g733a5