diff options
Diffstat (limited to 'crates/hir_ty/src/chalk_ext.rs')
-rw-r--r-- | crates/hir_ty/src/chalk_ext.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/hir_ty/src/chalk_ext.rs b/crates/hir_ty/src/chalk_ext.rs index 6a353423a..28ed3aac6 100644 --- a/crates/hir_ty/src/chalk_ext.rs +++ b/crates/hir_ty/src/chalk_ext.rs | |||
@@ -202,12 +202,12 @@ impl TyExt for Ty { | |||
202 | .map(|pred| pred.clone().substitute(&Interner, &substs)) | 202 | .map(|pred| pred.clone().substitute(&Interner, &substs)) |
203 | .filter(|wc| match &wc.skip_binders() { | 203 | .filter(|wc| match &wc.skip_binders() { |
204 | WhereClause::Implemented(tr) => { | 204 | WhereClause::Implemented(tr) => { |
205 | tr.self_type_parameter(&Interner) == self | 205 | &tr.self_type_parameter(&Interner) == self |
206 | } | 206 | } |
207 | WhereClause::AliasEq(AliasEq { | 207 | WhereClause::AliasEq(AliasEq { |
208 | alias: AliasTy::Projection(proj), | 208 | alias: AliasTy::Projection(proj), |
209 | ty: _, | 209 | ty: _, |
210 | }) => proj.self_type_parameter(&Interner) == self, | 210 | }) => &proj.self_type_parameter(&Interner) == self, |
211 | _ => false, | 211 | _ => false, |
212 | }) | 212 | }) |
213 | .collect::<Vec<_>>(); | 213 | .collect::<Vec<_>>(); |
@@ -293,3 +293,13 @@ impl ProjectionTyExt for ProjectionTy { | |||
293 | } | 293 | } |
294 | } | 294 | } |
295 | } | 295 | } |
296 | |||
297 | pub trait TraitRefExt { | ||
298 | fn hir_trait_id(&self) -> TraitId; | ||
299 | } | ||
300 | |||
301 | impl TraitRefExt for TraitRef { | ||
302 | fn hir_trait_id(&self) -> TraitId { | ||
303 | from_chalk_trait_id(self.trait_id) | ||
304 | } | ||
305 | } | ||