From c2000257941956cd4c4365d6eb6cdbc1b16e929c Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 21 Feb 2020 23:07:29 +0100 Subject: Fix shift_bound_vars It should only shift free vars (maybe the name isn't the best...) --- crates/ra_hir_ty/src/lib.rs | 6 +++--- 1 file 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 { where Self: Sized, { - self.fold(&mut |ty| match ty { - Ty::Bound(idx) => { + self.fold_binders(&mut |ty, binders| match ty { + Ty::Bound(idx) if idx as usize >= binders => { assert!(idx as i32 >= -n); Ty::Bound((idx as i32 + n) as u32) } ty => ty, - }) + }, 0) } } -- cgit v1.2.3