about summary refs log tree commit diff
path: root/compiler/rustc_query_impl
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-08 09:04:06 +0000
committerbors <bors@rust-lang.org>2021-10-08 09:04:06 +0000
commit44995f7afb18775913618ae50601be31b9f9dead (patch)
tree77ac1030bbb38e9c80d35297293ca06b10e166fc /compiler/rustc_query_impl
parent3013b26947e956352f95edfa39251319520cb06c (diff)
parentb7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573 (diff)
downloadrust-44995f7afb18775913618ae50601be31b9f9dead.tar.gz
rust-44995f7afb18775913618ae50601be31b9f9dead.zip
Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisa
Turn vtable_allocation() into a query

This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query.

The change is pretty straightforward and should be backportable without too much effort.

Fixes https://github.com/rust-lang/rust/issues/89598.
Diffstat (limited to 'compiler/rustc_query_impl')
-rw-r--r--compiler/rustc_query_impl/src/keys.rs11
1 files changed, 11 insertions, 0 deletions
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<ty::PolyExistentialTraitRef<'tcx>>) {
+    #[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 {