about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/keys.rs
diff options
context:
space:
mode:
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>;