diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer/coerce.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/coerce.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/infer/coerce.rs b/crates/ra_hir_ty/src/infer/coerce.rs index 4a0eabdfc..fb6a51b12 100644 --- a/crates/ra_hir_ty/src/infer/coerce.rs +++ b/crates/ra_hir_ty/src/infer/coerce.rs | |||
@@ -26,7 +26,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
26 | /// Note that it is only possible that one type are coerced to another. | 26 | /// Note that it is only possible that one type are coerced to another. |
27 | /// Coercing both types to another least upper bound type is not possible in rustc, | 27 | /// Coercing both types to another least upper bound type is not possible in rustc, |
28 | /// which will simply result in "incompatible types" error. | 28 | /// which will simply result in "incompatible types" error. |
29 | pub(super) fn coerce_merge_branch<'t>(&mut self, ty1: &Ty, ty2: &Ty) -> Ty { | 29 | pub(super) fn coerce_merge_branch(&mut self, ty1: &Ty, ty2: &Ty) -> Ty { |
30 | if self.coerce(ty1, ty2) { | 30 | if self.coerce(ty1, ty2) { |
31 | ty2.clone() | 31 | ty2.clone() |
32 | } else if self.coerce(ty2, ty1) { | 32 | } else if self.coerce(ty2, ty1) { |
@@ -252,15 +252,14 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
252 | let unsize_generic_index = { | 252 | let unsize_generic_index = { |
253 | let mut index = None; | 253 | let mut index = None; |
254 | let mut multiple_param = false; | 254 | let mut multiple_param = false; |
255 | field_tys[last_field_id].value.walk(&mut |ty| match ty { | 255 | field_tys[last_field_id].value.walk(&mut |ty| { |
256 | &Ty::Bound(idx) => { | 256 | if let &Ty::Bound(idx) = ty { |
257 | if index.is_none() { | 257 | if index.is_none() { |
258 | index = Some(idx); | 258 | index = Some(idx); |
259 | } else if Some(idx) != index { | 259 | } else if Some(idx) != index { |
260 | multiple_param = true; | 260 | multiple_param = true; |
261 | } | 261 | } |
262 | } | 262 | } |
263 | _ => {} | ||
264 | }); | 263 | }); |
265 | 264 | ||
266 | if multiple_param { | 265 | if multiple_param { |