1
Fork 0

Implement pointer casting.

This commit is contained in:
Charles Lew 2021-07-31 22:46:23 +08:00
parent 7069a8c2b7
commit 63ed625313
11 changed files with 256 additions and 88 deletions

View file

@ -282,6 +282,16 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx> {
}
}
impl<'tcx> Key for (ty::PolyTraitRef<'tcx>, ty::PolyTraitRef<'tcx>) {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {
self.0.def_id().krate == LOCAL_CRATE
}
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
tcx.def_span(self.0.def_id())
}
}
impl<'tcx> Key for GenericArg<'tcx> {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {