From b7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Thu, 7 Oct 2021 11:29:01 +0200 Subject: Turn tcx.vtable_allocation() into a query. --- compiler/rustc_query_impl/src/keys.rs | 11 +++++++++++ 1 file changed, 11 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 563a3cf1438..34489287596 100644 --- a/compiler/rustc_query_impl/src/keys.rs +++ b/compiler/rustc_query_impl/src/keys.rs @@ -72,6 +72,17 @@ impl<'tcx> Key for mir::interpret::GlobalId<'tcx> { } } +impl<'tcx> Key for (Ty<'tcx>, Option>) { + #[inline(always)] + fn query_crate_is_local(&self) -> bool { + true + } + + fn default_span(&self, _: TyCtxt<'_>) -> Span { + DUMMY_SP + } +} + impl<'tcx> Key for mir::interpret::LitToConstInput<'tcx> { #[inline(always)] fn query_crate_is_local(&self) -> bool { -- cgit 1.4.1-3-g733a5