From 63ed62531324cd4660deb7faff58e6c17b93b487 Mon Sep 17 00:00:00 2001 From: Charles Lew Date: Sat, 31 Jul 2021 22:46:23 +0800 Subject: Implement pointer casting. --- compiler/rustc_query_impl/src/keys.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/rustc_query_impl') diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs index 0ad360c7d89..ace7cffd16d 100644 --- a/compiler/rustc_query_impl/src/keys.rs +++ b/compiler/rustc_query_impl/src/keys.rs @@ -282,6 +282,16 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx> { } } +impl<'tcx> Key for (ty::PolyTraitRef<'tcx>, ty::PolyTraitRef<'tcx>) { + #[inline(always)] + fn query_crate_is_local(&self) -> bool { + self.0.def_id().krate == LOCAL_CRATE + } + fn default_span(&self, tcx: TyCtxt<'_>) -> Span { + tcx.def_span(self.0.def_id()) + } +} + impl<'tcx> Key for GenericArg<'tcx> { #[inline(always)] fn query_crate_is_local(&self) -> bool { -- cgit 1.4.1-3-g733a5