From 0c01b4eb6aaf86dd6a67cae7bc810916bfc20aeb Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 23 Apr 2020 20:50:14 +0200 Subject: Fix wrong substitution code We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though). --- crates/ra_hir_ty/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir_ty/src/lib.rs') diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index a4b8d6683..279c06d65 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -863,7 +863,7 @@ pub trait TypeWalk { &mut |ty, binders| { if let &mut Ty::Bound(bound) = ty { if bound.debruijn >= binders { - *ty = substs.0[bound.index].clone(); + *ty = substs.0[bound.index].clone().shift_bound_vars(binders); } } }, -- cgit v1.2.3