about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2021-09-01 23:04:28 +0100
committerGary Guo <gary@garyguo.net>2021-09-05 18:13:32 +0100
commit97214eecc5a6c35c6cd8d9798207175cc2e15812 (patch)
tree6c85449f45111d88588b3ac8013242c4bd06b59a /compiler/rustc_query_impl/src
parent871eb6233ed4b5c3a3c5fe96e88e4dacc046e45f (diff)
downloadrust-97214eecc5a6c35c6cd8d9798207175cc2e15812.tar.gz
rust-97214eecc5a6c35c6cd8d9798207175cc2e15812.zip
Add query `own_existential_vtable_entries`
Diffstat (limited to 'compiler/rustc_query_impl/src')
-rw-r--r--compiler/rustc_query_impl/src/keys.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs
index c973eae6b06..42e8b4023cf 100644
--- a/compiler/rustc_query_impl/src/keys.rs
+++ b/compiler/rustc_query_impl/src/keys.rs
@@ -294,6 +294,16 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx> {
     }
 }
 
+impl<'tcx> Key for ty::PolyExistentialTraitRef<'tcx> {
+    #[inline(always)]
+    fn query_crate_is_local(&self) -> bool {
+        self.def_id().krate == LOCAL_CRATE
+    }
+    fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
+        tcx.def_span(self.def_id())
+    }
+}
+
 impl<'tcx> Key for (ty::PolyTraitRef<'tcx>, ty::PolyTraitRef<'tcx>) {
     #[inline(always)]
     fn query_crate_is_local(&self) -> bool {