diff options
author | Florian Diebold <[email protected]> | 2020-02-21 22:07:29 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-02-22 10:09:21 +0000 |
commit | c2000257941956cd4c4365d6eb6cdbc1b16e929c (patch) | |
tree | a27ef5bdc8452e89d44255cee8999df8477e136a | |
parent | 463df6720cc8d2c7176a48a0ca8f4e333016a16a (diff) |
Fix shift_bound_vars
It should only shift free vars (maybe the name isn't the best...)
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 6 |
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 | ||