diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer/coerce.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/coerce.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/infer/coerce.rs b/crates/ra_hir_ty/src/infer/coerce.rs index 83c0c2c3f..2a9567898 100644 --- a/crates/ra_hir_ty/src/infer/coerce.rs +++ b/crates/ra_hir_ty/src/infer/coerce.rs | |||
@@ -57,8 +57,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
57 | let trait_ref = db.impl_trait(impl_id)?; | 57 | let trait_ref = db.impl_trait(impl_id)?; |
58 | 58 | ||
59 | // `CoerseUnsized` has one generic parameter for the target type. | 59 | // `CoerseUnsized` has one generic parameter for the target type. |
60 | let cur_from_ty = trait_ref.substs.0.get(0)?; | 60 | let cur_from_ty = trait_ref.value.substs.0.get(0)?; |
61 | let cur_to_ty = trait_ref.substs.0.get(1)?; | 61 | let cur_to_ty = trait_ref.value.substs.0.get(1)?; |
62 | 62 | ||
63 | match (&cur_from_ty, cur_to_ty) { | 63 | match (&cur_from_ty, cur_to_ty) { |
64 | (ty_app!(ctor1, st1), ty_app!(ctor2, st2)) => { | 64 | (ty_app!(ctor1, st1), ty_app!(ctor2, st2)) => { |
@@ -66,8 +66,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
66 | // This works for smart-pointer-like coercion, which covers all impls from std. | 66 | // This works for smart-pointer-like coercion, which covers all impls from std. |
67 | st1.iter().zip(st2.iter()).enumerate().find_map(|(i, (ty1, ty2))| { | 67 | st1.iter().zip(st2.iter()).enumerate().find_map(|(i, (ty1, ty2))| { |
68 | match (ty1, ty2) { | 68 | match (ty1, ty2) { |
69 | (Ty::Param { idx: p1, .. }, Ty::Param { idx: p2, .. }) | 69 | (Ty::Bound(idx1), Ty::Bound(idx2)) |
70 | if p1 != p2 => | 70 | if idx1 != idx2 => |
71 | { | 71 | { |
72 | Some(((*ctor1, *ctor2), i)) | 72 | Some(((*ctor1, *ctor2), i)) |
73 | } | 73 | } |
@@ -256,8 +256,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
256 | let unsize_generic_index = { | 256 | let unsize_generic_index = { |
257 | let mut index = None; | 257 | let mut index = None; |
258 | let mut multiple_param = false; | 258 | let mut multiple_param = false; |
259 | field_tys[last_field_id].walk(&mut |ty| match ty { | 259 | field_tys[last_field_id].value.walk(&mut |ty| match ty { |
260 | &Ty::Param { idx, .. } => { | 260 | &Ty::Bound(idx) => { |
261 | if index.is_none() { | 261 | if index.is_none() { |
262 | index = Some(idx); | 262 | index = Some(idx); |
263 | } else if Some(idx) != index { | 263 | } else if Some(idx) != index { |
@@ -276,8 +276,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
276 | // Check other fields do not involve it. | 276 | // Check other fields do not involve it. |
277 | let mut multiple_used = false; | 277 | let mut multiple_used = false; |
278 | fields.for_each(|(field_id, _data)| { | 278 | fields.for_each(|(field_id, _data)| { |
279 | field_tys[field_id].walk(&mut |ty| match ty { | 279 | field_tys[field_id].value.walk(&mut |ty| match ty { |
280 | &Ty::Param { idx, .. } if idx == unsize_generic_index => { | 280 | &Ty::Bound(idx) if idx == unsize_generic_index => { |
281 | multiple_used = true | 281 | multiple_used = true |
282 | } | 282 | } |
283 | _ => {} | 283 | _ => {} |