diff options
Diffstat (limited to 'crates/ra_hir/src/ty/infer/unify.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer/unify.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs index 04633bdb2..49bf5b946 100644 --- a/crates/ra_hir/src/ty/infer/unify.rs +++ b/crates/ra_hir/src/ty/infer/unify.rs | |||
@@ -102,7 +102,7 @@ impl<T> Canonicalized<T> { | |||
102 | ty.fold(&mut |ty| match ty { | 102 | ty.fold(&mut |ty| match ty { |
103 | Ty::Bound(idx) => { | 103 | Ty::Bound(idx) => { |
104 | if (idx as usize) < self.free_vars.len() { | 104 | if (idx as usize) < self.free_vars.len() { |
105 | Ty::Infer(self.free_vars[idx as usize].clone()) | 105 | Ty::Infer(self.free_vars[idx as usize]) |
106 | } else { | 106 | } else { |
107 | Ty::Bound(idx) | 107 | Ty::Bound(idx) |
108 | } | 108 | } |
@@ -120,7 +120,7 @@ impl<T> Canonicalized<T> { | |||
120 | let new_vars = | 120 | let new_vars = |
121 | (0..solution.num_vars).map(|_| ctx.new_type_var()).collect::<Vec<_>>().into(); | 121 | (0..solution.num_vars).map(|_| ctx.new_type_var()).collect::<Vec<_>>().into(); |
122 | for (i, ty) in solution.value.into_iter().enumerate() { | 122 | for (i, ty) in solution.value.into_iter().enumerate() { |
123 | let var = self.free_vars[i].clone(); | 123 | let var = self.free_vars[i]; |
124 | ctx.unify(&Ty::Infer(var), &ty.subst_bound_vars(&new_vars)); | 124 | ctx.unify(&Ty::Infer(var), &ty.subst_bound_vars(&new_vars)); |
125 | } | 125 | } |
126 | } | 126 | } |