aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs
index 2f2d3080e..182f847f1 100644
--- a/crates/ra_hir_ty/src/lib.rs
+++ b/crates/ra_hir_ty/src/lib.rs
@@ -814,13 +814,13 @@ pub trait TypeWalk {
814 where 814 where
815 Self: Sized, 815 Self: Sized,
816 { 816 {
817 self.fold(&mut |ty| match ty { 817 self.fold_binders(&mut |ty, binders| match ty {
818 Ty::Bound(idx) => { 818 Ty::Bound(idx) if idx as usize >= binders => {
819 assert!(idx as i32 >= -n); 819 assert!(idx as i32 >= -n);
820 Ty::Bound((idx as i32 + n) as u32) 820 Ty::Bound((idx as i32 + n) as u32)
821 } 821 }
822 ty => ty, 822 ty => ty,
823 }) 823 }, 0)
824 } 824 }
825} 825}
826 826