use ty::Unevaluated instead of def substs pair

This commit is contained in:
lcnr 2021-07-19 13:52:43 +02:00
parent 031243898e
commit caa975c89e
19 changed files with 66 additions and 86 deletions

View file

@ -217,18 +217,13 @@ impl<'tcx> Key for (DefId, SubstsRef<'tcx>) {
}
}
impl<'tcx> Key
for (
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
)
{
impl<'tcx> Key for (ty::Unevaluated<'tcx>, ty::Unevaluated<'tcx>) {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {
(self.0).0.did.krate == LOCAL_CRATE
(self.0).def.did.krate == LOCAL_CRATE
}
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
(self.0).0.did.default_span(tcx)
(self.0).def.did.default_span(tcx)
}
}