aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2021-04-05 15:38:37 +0100
committerLaurenČ›iu Nicola <[email protected]>2021-04-05 15:38:37 +0100
commitd7546d8c2323adff53c8170c528e82a8131681c5 (patch)
tree511c31f0b647044294eba7c4394ee3e4ba7b13b6 /crates/hir_ty/src/lib.rs
parentaefcbf275804f558ab18e83bfc8869187713b4ad (diff)
Pass interner to TraitRef::self_type_parameter
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 80dd7aaca..adfdcaa37 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -165,8 +165,8 @@ impl<T: TypeWalk> Binders<T> {
165} 165}
166 166
167impl TraitRef { 167impl TraitRef {
168 pub fn self_type_parameter(&self) -> &Ty { 168 pub fn self_type_parameter(&self, interner: &Interner) -> &Ty {
169 &self.substitution.at(&Interner, 0).assert_ty_ref(&Interner) 169 &self.substitution.at(interner, 0).assert_ty_ref(interner)
170 } 170 }
171 171
172 pub fn hir_trait_id(&self) -> TraitId { 172 pub fn hir_trait_id(&self) -> TraitId {
@@ -473,7 +473,9 @@ impl Ty {
473 .into_iter() 473 .into_iter()
474 .map(|pred| pred.clone().subst(&substs)) 474 .map(|pred| pred.clone().subst(&substs))
475 .filter(|wc| match &wc.skip_binders() { 475 .filter(|wc| match &wc.skip_binders() {
476 WhereClause::Implemented(tr) => tr.self_type_parameter() == self, 476 WhereClause::Implemented(tr) => {
477 tr.self_type_parameter(&Interner) == self
478 }
477 WhereClause::AliasEq(AliasEq { 479 WhereClause::AliasEq(AliasEq {
478 alias: AliasTy::Projection(proj), 480 alias: AliasTy::Projection(proj),
479 ty: _, 481 ty: _,