aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/display.rs4
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs6
-rw-r--r--crates/ra_hir_ty/src/lib.rs2
-rw-r--r--crates/ra_hir_ty/src/lower.rs3
4 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_hir_ty/src/display.rs b/crates/ra_hir_ty/src/display.rs
index 23cea1a2a..ac68c5661 100644
--- a/crates/ra_hir_ty/src/display.rs
+++ b/crates/ra_hir_ty/src/display.rs
@@ -369,7 +369,7 @@ impl HirDisplay for ApplicationTy {
369 let data = (*datas) 369 let data = (*datas)
370 .as_ref() 370 .as_ref()
371 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 371 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
372 data.clone().subst(&self.parameters) 372 data.subst(&self.parameters)
373 } 373 }
374 }; 374 };
375 write!(f, "impl ")?; 375 write!(f, "impl ")?;
@@ -456,7 +456,7 @@ impl HirDisplay for Ty {
456 let data = (*datas) 456 let data = (*datas)
457 .as_ref() 457 .as_ref()
458 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 458 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
459 data.clone().subst(&opaque_ty.parameters) 459 data.subst(&opaque_ty.parameters)
460 } 460 }
461 }; 461 };
462 write!(f, "impl ")?; 462 write!(f, "impl ")?;
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs
index 22884522a..06baac2a9 100644
--- a/crates/ra_hir_ty/src/infer/expr.rs
+++ b/crates/ra_hir_ty/src/infer/expr.rs
@@ -85,10 +85,8 @@ impl<'a> InferenceContext<'a> {
85 ctor: TypeCtor::Tuple { cardinality: num_args as u16 }, 85 ctor: TypeCtor::Tuple { cardinality: num_args as u16 },
86 parameters, 86 parameters,
87 }); 87 });
88 let substs = Substs::build_for_generics(&generic_params) 88 let substs =
89 .push(ty.clone()) 89 Substs::build_for_generics(&generic_params).push(ty.clone()).push(arg_ty).build();
90 .push(arg_ty.clone())
91 .build();
92 90
93 let trait_env = Arc::clone(&self.trait_env); 91 let trait_env = Arc::clone(&self.trait_env);
94 let implements_fn_trait = 92 let implements_fn_trait =
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs
index 7f3f5e771..c12bed4af 100644
--- a/crates/ra_hir_ty/src/lib.rs
+++ b/crates/ra_hir_ty/src/lib.rs
@@ -891,7 +891,7 @@ impl Ty {
891 let data = (*it) 891 let data = (*it)
892 .as_ref() 892 .as_ref()
893 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 893 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
894 data.clone().subst(&opaque_ty.parameters) 894 data.subst(&opaque_ty.parameters)
895 }) 895 })
896 } 896 }
897 }; 897 };
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs
index 3dc154e92..01af3187b 100644
--- a/crates/ra_hir_ty/src/lower.rs
+++ b/crates/ra_hir_ty/src/lower.rs
@@ -720,8 +720,7 @@ fn assoc_type_bindings_from_type_bound<'a>(
720 None => return SmallVec::<[GenericPredicate; 1]>::new(), 720 None => return SmallVec::<[GenericPredicate; 1]>::new(),
721 Some(t) => t, 721 Some(t) => t,
722 }; 722 };
723 let projection_ty = 723 let projection_ty = ProjectionTy { associated_ty, parameters: super_trait_ref.substs };
724 ProjectionTy { associated_ty, parameters: super_trait_ref.substs.clone() };
725 let mut preds = SmallVec::with_capacity( 724 let mut preds = SmallVec::with_capacity(
726 binding.type_ref.as_ref().map_or(0, |_| 1) + binding.bounds.len(), 725 binding.type_ref.as_ref().map_or(0, |_| 1) + binding.bounds.len(),
727 ); 726 );