diff options
Diffstat (limited to 'crates/ra_hir_ty/src/lib.rs')
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 571579cc4..13c5e6c6b 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs | |||
@@ -167,7 +167,7 @@ impl TypeCtor { | |||
167 | | TypeCtor::Closure { .. } // 1 param representing the signature of the closure | 167 | | TypeCtor::Closure { .. } // 1 param representing the signature of the closure |
168 | => 1, | 168 | => 1, |
169 | TypeCtor::Adt(adt) => { | 169 | TypeCtor::Adt(adt) => { |
170 | let generic_params = generics(db, AdtId::from(adt).into()); | 170 | let generic_params = generics(db, adt.into()); |
171 | generic_params.len() | 171 | generic_params.len() |
172 | } | 172 | } |
173 | TypeCtor::FnDef(callable) => { | 173 | TypeCtor::FnDef(callable) => { |
@@ -247,7 +247,7 @@ pub struct ProjectionTy { | |||
247 | 247 | ||
248 | impl ProjectionTy { | 248 | impl ProjectionTy { |
249 | pub fn trait_ref(&self, db: &impl HirDatabase) -> TraitRef { | 249 | pub fn trait_ref(&self, db: &impl HirDatabase) -> TraitRef { |
250 | TraitRef { trait_: self.trait_(db).into(), substs: self.parameters.clone() } | 250 | TraitRef { trait_: self.trait_(db), substs: self.parameters.clone() } |
251 | } | 251 | } |
252 | 252 | ||
253 | fn trait_(&self, db: &impl HirDatabase) -> TraitId { | 253 | fn trait_(&self, db: &impl HirDatabase) -> TraitId { |
@@ -763,8 +763,8 @@ pub trait TypeWalk { | |||
763 | Self: Sized, | 763 | Self: Sized, |
764 | { | 764 | { |
765 | self.walk_mut_binders( | 765 | self.walk_mut_binders( |
766 | &mut |ty, binders| match ty { | 766 | &mut |ty, binders| { |
767 | &mut Ty::Bound(idx) => { | 767 | if let &mut Ty::Bound(idx) = ty { |
768 | if idx as usize >= binders && (idx as usize - binders) < substs.len() { | 768 | if idx as usize >= binders && (idx as usize - binders) < substs.len() { |
769 | *ty = substs.0[idx as usize - binders].clone(); | 769 | *ty = substs.0[idx as usize - binders].clone(); |
770 | } else if idx as usize >= binders + substs.len() { | 770 | } else if idx as usize >= binders + substs.len() { |
@@ -772,7 +772,6 @@ pub trait TypeWalk { | |||
772 | *ty = Ty::Bound(idx - substs.len() as u32); | 772 | *ty = Ty::Bound(idx - substs.len() as u32); |
773 | } | 773 | } |
774 | } | 774 | } |
775 | _ => {} | ||
776 | }, | 775 | }, |
777 | 0, | 776 | 0, |
778 | ); | 777 | ); |