aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/expr.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-05 20:17:35 +0100
committerFlorian Diebold <[email protected]>2021-04-05 20:58:03 +0100
commit2f5a77658baafad1fe3551971ebbcdce87760847 (patch)
tree940789c56348e2994d8941136fbc2f5dfc90fbc2 /crates/hir_ty/src/infer/expr.rs
parent788533d38091472ed05c8b55fd7a2002c49f4eb7 (diff)
Substitution::single -> from1
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r--crates/hir_ty/src/infer/expr.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs
index 56a9365cb..82ab9c5fe 100644
--- a/crates/hir_ty/src/infer/expr.rs
+++ b/crates/hir_ty/src/infer/expr.rs
@@ -180,7 +180,8 @@ impl<'a> InferenceContext<'a> {
180 let inner_ty = self.infer_expr(*body, &Expectation::none()); 180 let inner_ty = self.infer_expr(*body, &Expectation::none());
181 let impl_trait_id = crate::ImplTraitId::AsyncBlockTypeImplTrait(self.owner, *body); 181 let impl_trait_id = crate::ImplTraitId::AsyncBlockTypeImplTrait(self.owner, *body);
182 let opaque_ty_id = self.db.intern_impl_trait_id(impl_trait_id).into(); 182 let opaque_ty_id = self.db.intern_impl_trait_id(impl_trait_id).into();
183 TyKind::OpaqueType(opaque_ty_id, Substitution::single(inner_ty)).intern(&Interner) 183 TyKind::OpaqueType(opaque_ty_id, Substitution::from1(&Interner, inner_ty))
184 .intern(&Interner)
184 } 185 }
185 Expr::Loop { body, label } => { 186 Expr::Loop { body, label } => {
186 self.breakables.push(BreakableContext { 187 self.breakables.push(BreakableContext {
@@ -266,7 +267,8 @@ impl<'a> InferenceContext<'a> {
266 .intern(&Interner); 267 .intern(&Interner);
267 let closure_id = self.db.intern_closure((self.owner, tgt_expr)).into(); 268 let closure_id = self.db.intern_closure((self.owner, tgt_expr)).into();
268 let closure_ty = 269 let closure_ty =
269 TyKind::Closure(closure_id, Substitution::single(sig_ty)).intern(&Interner); 270 TyKind::Closure(closure_id, Substitution::from1(&Interner, sig_ty))
271 .intern(&Interner);
270 272
271 // Eagerly try to relate the closure type with the expected 273 // Eagerly try to relate the closure type with the expected
272 // type, otherwise we often won't have enough information to 274 // type, otherwise we often won't have enough information to