diff options
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index f5d8cd4b1..e79e5e223 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -849,12 +849,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
849 | fn register_obligations_for_call(&mut self, callable_ty: &Ty) { | 849 | fn register_obligations_for_call(&mut self, callable_ty: &Ty) { |
850 | if let Ty::Apply(a_ty) = callable_ty { | 850 | if let Ty::Apply(a_ty) = callable_ty { |
851 | if let TypeCtor::FnDef(def) = a_ty.ctor { | 851 | if let TypeCtor::FnDef(def) = a_ty.ctor { |
852 | let generic_predicates = self.db.generic_predicates(match def { | 852 | let generic_predicates = self.db.generic_predicates(def.into()); |
853 | // TODO add helper function | ||
854 | CallableDef::Function(f) => f.into(), | ||
855 | CallableDef::Struct(s) => s.into(), | ||
856 | CallableDef::EnumVariant(_e) => unimplemented!(), | ||
857 | }); | ||
858 | for predicate in generic_predicates.iter() { | 853 | for predicate in generic_predicates.iter() { |
859 | let predicate = predicate.clone().subst(&a_ty.parameters); | 854 | let predicate = predicate.clone().subst(&a_ty.parameters); |
860 | if let Some(obligation) = Obligation::from_predicate(predicate) { | 855 | if let Some(obligation) = Obligation::from_predicate(predicate) { |