about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/keys.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-06-14 20:35:45 -0400
committerMichael Goulet <michael@errs.io>2024-06-14 20:35:45 -0400
commit3b9adbec32757264ba30b68e04ce66d6023810aa (patch)
treebd4fd5886f0ad837424f46980f3196a912aafe62 /compiler/rustc_middle/src/query/keys.rs
parentf8e566053207b4ecbcbc7a7d6ded82c43061e3da (diff)
downloadrust-3b9adbec32757264ba30b68e04ce66d6023810aa.tar.gz
rust-3b9adbec32757264ba30b68e04ce66d6023810aa.zip
Only compute vtable information during codegen
Diffstat (limited to 'compiler/rustc_middle/src/query/keys.rs')
-rw-r--r--compiler/rustc_middle/src/query/keys.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/query/keys.rs b/compiler/rustc_middle/src/query/keys.rs
index faa137019cb..5452e1dff3e 100644
--- a/compiler/rustc_middle/src/query/keys.rs
+++ b/compiler/rustc_middle/src/query/keys.rs
@@ -360,6 +360,14 @@ impl<'tcx> Key for (ty::ParamEnv<'tcx>, ty::TraitRef<'tcx>) {
     }
 }
 
+impl<'tcx> Key for ty::TraitRef<'tcx> {
+    type Cache<V> = DefaultCache<Self, V>;
+
+    fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
+        tcx.def_span(self.def_id)
+    }
+}
+
 impl<'tcx> Key for ty::PolyTraitRef<'tcx> {
     type Cache<V> = DefaultCache<Self, V>;