From 2f5a77658baafad1fe3551971ebbcdce87760847 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 21:17:35 +0200 Subject: Substitution::single -> from1 --- crates/hir_ty/src/infer/expr.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/infer') 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> { let inner_ty = self.infer_expr(*body, &Expectation::none()); let impl_trait_id = crate::ImplTraitId::AsyncBlockTypeImplTrait(self.owner, *body); let opaque_ty_id = self.db.intern_impl_trait_id(impl_trait_id).into(); - TyKind::OpaqueType(opaque_ty_id, Substitution::single(inner_ty)).intern(&Interner) + TyKind::OpaqueType(opaque_ty_id, Substitution::from1(&Interner, inner_ty)) + .intern(&Interner) } Expr::Loop { body, label } => { self.breakables.push(BreakableContext { @@ -266,7 +267,8 @@ impl<'a> InferenceContext<'a> { .intern(&Interner); let closure_id = self.db.intern_closure((self.owner, tgt_expr)).into(); let closure_ty = - TyKind::Closure(closure_id, Substitution::single(sig_ty)).intern(&Interner); + TyKind::Closure(closure_id, Substitution::from1(&Interner, sig_ty)) + .intern(&Interner); // Eagerly try to relate the closure type with the expected // type, otherwise we often won't have enough information to -- cgit v1.2.3