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