diff options
author | Florian Diebold <[email protected]> | 2020-04-23 19:50:14 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-04-23 22:53:08 +0100 |
commit | 0c01b4eb6aaf86dd6a67cae7bc810916bfc20aeb (patch) | |
tree | 8981f17bcd77c0b151437aa4c39d54a9dc1d13be /crates/ra_hir_ty/src/lib.rs | |
parent | 29bc218fba2e52711b038562ff23bbb76a002380 (diff) |
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).
Diffstat (limited to 'crates/ra_hir_ty/src/lib.rs')
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 { | |||
863 | &mut |ty, binders| { | 863 | &mut |ty, binders| { |
864 | if let &mut Ty::Bound(bound) = ty { | 864 | if let &mut Ty::Bound(bound) = ty { |
865 | if bound.debruijn >= binders { | 865 | if bound.debruijn >= binders { |
866 | *ty = substs.0[bound.index].clone(); | 866 | *ty = substs.0[bound.index].clone().shift_bound_vars(binders); |
867 | } | 867 | } |
868 | } | 868 | } |
869 | }, | 869 | }, |