diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-25 15:58:54 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-25 15:58:54 +0000 |
commit | 58a3b3b502580e9f49dcfc9b7223e8aec258adf6 (patch) | |
tree | 3fe683f845d7b3b47f44337303dac2ff8312a832 /crates/ra_hir/src/ty/infer | |
parent | ecd1204804a2a3c8b9b98e4b9d18feef06ab51c7 (diff) | |
parent | 1a0da6d4dad846568042f85ad7225b45b3275e49 (diff) |
Merge #2404
2404: Use TypeAliasId in Ty, pt 2 r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/infer')
-rw-r--r-- | crates/ra_hir/src/ty/infer/expr.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs index 994a6d7e9..316cdc880 100644 --- a/crates/ra_hir/src/ty/infer/expr.rs +++ b/crates/ra_hir/src/ty/infer/expr.rs | |||
@@ -101,7 +101,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
101 | let projection = ProjectionPredicate { | 101 | let projection = ProjectionPredicate { |
102 | ty: pat_ty.clone(), | 102 | ty: pat_ty.clone(), |
103 | projection_ty: ProjectionTy { | 103 | projection_ty: ProjectionTy { |
104 | associated_ty: into_iter_item_alias, | 104 | associated_ty: into_iter_item_alias.id, |
105 | parameters: Substs::single(iterable_ty), | 105 | parameters: Substs::single(iterable_ty), |
106 | }, | 106 | }, |
107 | }; | 107 | }; |
@@ -137,8 +137,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
137 | TypeCtor::FnPtr { num_args: sig_tys.len() as u16 - 1 }, | 137 | TypeCtor::FnPtr { num_args: sig_tys.len() as u16 - 1 }, |
138 | Substs(sig_tys.into()), | 138 | Substs(sig_tys.into()), |
139 | ); | 139 | ); |
140 | let closure_ty = | 140 | let closure_ty = Ty::apply_one( |
141 | Ty::apply_one(TypeCtor::Closure { def: self.owner, expr: tgt_expr }, sig_ty); | 141 | TypeCtor::Closure { def: self.owner.into(), expr: tgt_expr }, |
142 | sig_ty, | ||
143 | ); | ||
142 | 144 | ||
143 | // Eagerly try to relate the closure type with the expected | 145 | // Eagerly try to relate the closure type with the expected |
144 | // type, otherwise we often won't have enough information to | 146 | // type, otherwise we often won't have enough information to |
@@ -281,7 +283,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
281 | let projection = ProjectionPredicate { | 283 | let projection = ProjectionPredicate { |
282 | ty: ty.clone(), | 284 | ty: ty.clone(), |
283 | projection_ty: ProjectionTy { | 285 | projection_ty: ProjectionTy { |
284 | associated_ty: future_future_output_alias, | 286 | associated_ty: future_future_output_alias.id, |
285 | parameters: Substs::single(inner_ty), | 287 | parameters: Substs::single(inner_ty), |
286 | }, | 288 | }, |
287 | }; | 289 | }; |
@@ -300,7 +302,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
300 | let projection = ProjectionPredicate { | 302 | let projection = ProjectionPredicate { |
301 | ty: ty.clone(), | 303 | ty: ty.clone(), |
302 | projection_ty: ProjectionTy { | 304 | projection_ty: ProjectionTy { |
303 | associated_ty: ops_try_ok_alias, | 305 | associated_ty: ops_try_ok_alias.id, |
304 | parameters: Substs::single(inner_ty), | 306 | parameters: Substs::single(inner_ty), |
305 | }, | 307 | }, |
306 | }; | 308 | }; |