diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-07 19:51:36 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-07 19:51:36 +0100 |
commit | 3191a93185b34c6deebca2aad0584d2840ad6d43 (patch) | |
tree | 1fad465381a5b9a9d0b77dbf68a246db1835f511 /crates/hir_ty/src/chalk_ext.rs | |
parent | 6379839c8203b6fbc9af947997a7f73a36ef15a2 (diff) | |
parent | dc116f7ce2192433c9491441a11d294e7d294fbf (diff) |
Merge #8409
8409: Various remaining fixes for Chalk IR move r=flodiebold a=flodiebold
CC #8313
Co-authored-by: Florian Diebold <[email protected]>
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 | } | ||