mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Pass interner to TraitRef::self_type_parameter
This commit is contained in:
parent
aefcbf2758
commit
d7546d8c23
4 changed files with 24 additions and 20 deletions
|
@ -165,8 +165,8 @@ impl<T: TypeWalk> Binders<T> {
|
|||
}
|
||||
|
||||
impl TraitRef {
|
||||
pub fn self_type_parameter(&self) -> &Ty {
|
||||
&self.substitution.at(&Interner, 0).assert_ty_ref(&Interner)
|
||||
pub fn self_type_parameter(&self, interner: &Interner) -> &Ty {
|
||||
&self.substitution.at(interner, 0).assert_ty_ref(interner)
|
||||
}
|
||||
|
||||
pub fn hir_trait_id(&self) -> TraitId {
|
||||
|
@ -473,7 +473,9 @@ impl Ty {
|
|||
.into_iter()
|
||||
.map(|pred| pred.clone().subst(&substs))
|
||||
.filter(|wc| match &wc.skip_binders() {
|
||||
WhereClause::Implemented(tr) => tr.self_type_parameter() == self,
|
||||
WhereClause::Implemented(tr) => {
|
||||
tr.self_type_parameter(&Interner) == self
|
||||
}
|
||||
WhereClause::AliasEq(AliasEq {
|
||||
alias: AliasTy::Projection(proj),
|
||||
ty: _,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue