aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r--crates/hir_ty/src/infer.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index bc52f447d..8cf59821f 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -294,7 +294,7 @@ impl<'a> InferenceContext<'a> {
294 // FIXME use right resolver for block 294 // FIXME use right resolver for block
295 let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver) 295 let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver)
296 .with_impl_trait_mode(impl_trait_mode); 296 .with_impl_trait_mode(impl_trait_mode);
297 let ty = Ty::from_hir(&ctx, type_ref); 297 let ty = ctx.lower_ty(type_ref);
298 let ty = self.insert_type_vars(ty); 298 let ty = self.insert_type_vars(ty);
299 self.normalize_associated_types_in(ty) 299 self.normalize_associated_types_in(ty)
300 } 300 }
@@ -437,19 +437,19 @@ impl<'a> InferenceContext<'a> {
437 }; 437 };
438 return match resolution { 438 return match resolution {
439 TypeNs::AdtId(AdtId::StructId(strukt)) => { 439 TypeNs::AdtId(AdtId::StructId(strukt)) => {
440 let substs = Ty::substs_from_path(&ctx, path, strukt.into(), true); 440 let substs = ctx.substs_from_path(path, strukt.into(), true);
441 let ty = self.db.ty(strukt.into()); 441 let ty = self.db.ty(strukt.into());
442 let ty = self.insert_type_vars(ty.subst(&substs)); 442 let ty = self.insert_type_vars(ty.subst(&substs));
443 forbid_unresolved_segments((ty, Some(strukt.into())), unresolved) 443 forbid_unresolved_segments((ty, Some(strukt.into())), unresolved)
444 } 444 }
445 TypeNs::AdtId(AdtId::UnionId(u)) => { 445 TypeNs::AdtId(AdtId::UnionId(u)) => {
446 let substs = Ty::substs_from_path(&ctx, path, u.into(), true); 446 let substs = ctx.substs_from_path(path, u.into(), true);
447 let ty = self.db.ty(u.into()); 447 let ty = self.db.ty(u.into());
448 let ty = self.insert_type_vars(ty.subst(&substs)); 448 let ty = self.insert_type_vars(ty.subst(&substs));
449 forbid_unresolved_segments((ty, Some(u.into())), unresolved) 449 forbid_unresolved_segments((ty, Some(u.into())), unresolved)
450 } 450 }
451 TypeNs::EnumVariantId(var) => { 451 TypeNs::EnumVariantId(var) => {
452 let substs = Ty::substs_from_path(&ctx, path, var.into(), true); 452 let substs = ctx.substs_from_path(path, var.into(), true);
453 let ty = self.db.ty(var.parent.into()); 453 let ty = self.db.ty(var.parent.into());
454 let ty = self.insert_type_vars(ty.subst(&substs)); 454 let ty = self.insert_type_vars(ty.subst(&substs));
455 forbid_unresolved_segments((ty, Some(var.into())), unresolved) 455 forbid_unresolved_segments((ty, Some(var.into())), unresolved)
@@ -541,7 +541,7 @@ impl<'a> InferenceContext<'a> {
541 let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver) 541 let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver)
542 .with_impl_trait_mode(ImplTraitLoweringMode::Param); 542 .with_impl_trait_mode(ImplTraitLoweringMode::Param);
543 let param_tys = 543 let param_tys =
544 data.params.iter().map(|type_ref| Ty::from_hir(&ctx, type_ref)).collect::<Vec<_>>(); 544 data.params.iter().map(|type_ref| ctx.lower_ty(type_ref)).collect::<Vec<_>>();
545 for (ty, pat) in param_tys.into_iter().zip(body.params.iter()) { 545 for (ty, pat) in param_tys.into_iter().zip(body.params.iter()) {
546 let ty = self.insert_type_vars(ty); 546 let ty = self.insert_type_vars(ty);
547 let ty = self.normalize_associated_types_in(ty); 547 let ty = self.normalize_associated_types_in(ty);