8409: Various remaining fixes for Chalk IR move r=flodiebold a=flodiebold

CC #8313

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This commit is contained in:
bors[bot] 2021-04-07 18:51:36 +00:00 committed by GitHub
commit 3191a93185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 79 additions and 71 deletions

View file

@ -202,12 +202,12 @@ impl TyExt for Ty {
.map(|pred| pred.clone().substitute(&Interner, &substs))
.filter(|wc| match &wc.skip_binders() {
WhereClause::Implemented(tr) => {
tr.self_type_parameter(&Interner) == self
&tr.self_type_parameter(&Interner) == self
}
WhereClause::AliasEq(AliasEq {
alias: AliasTy::Projection(proj),
ty: _,
}) => proj.self_type_parameter(&Interner) == self,
}) => &proj.self_type_parameter(&Interner) == self,
_ => false,
})
.collect::<Vec<_>>();
@ -293,3 +293,13 @@ impl ProjectionTyExt for ProjectionTy {
}
}
}
pub trait TraitRefExt {
fn hir_trait_id(&self) -> TraitId;
}
impl TraitRefExt for TraitRef {
fn hir_trait_id(&self) -> TraitId {
from_chalk_trait_id(self.trait_id)
}
}