diff options
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index a72424dc7..153f22f25 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -19,7 +19,7 @@ use crate::{ | |||
19 | method_resolution, op, | 19 | method_resolution, op, |
20 | primitive::{self, UintTy}, | 20 | primitive::{self, UintTy}, |
21 | to_assoc_type_id, | 21 | to_assoc_type_id, |
22 | traits::{FnTrait, InEnvironment}, | 22 | traits::{chalk::from_chalk, FnTrait, InEnvironment}, |
23 | utils::{generics, variant_data, Generics}, | 23 | utils::{generics, variant_data, Generics}, |
24 | AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Obligation, OpaqueTyId, Rawness, | 24 | AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Obligation, OpaqueTyId, Rawness, |
25 | Scalar, Substs, TraitRef, Ty, TyKind, | 25 | Scalar, Substs, TraitRef, Ty, TyKind, |
@@ -932,8 +932,9 @@ impl<'a> InferenceContext<'a> { | |||
932 | } | 932 | } |
933 | 933 | ||
934 | fn register_obligations_for_call(&mut self, callable_ty: &Ty) { | 934 | fn register_obligations_for_call(&mut self, callable_ty: &Ty) { |
935 | if let TyKind::FnDef(def, parameters) = callable_ty.interned(&Interner) { | 935 | if let TyKind::FnDef(fn_def, parameters) = callable_ty.interned(&Interner) { |
936 | let generic_predicates = self.db.generic_predicates((*def).into()); | 936 | let def: CallableDefId = from_chalk(self.db, *fn_def); |
937 | let generic_predicates = self.db.generic_predicates(def.into()); | ||
937 | for predicate in generic_predicates.iter() { | 938 | for predicate in generic_predicates.iter() { |
938 | let predicate = predicate.clone().subst(parameters); | 939 | let predicate = predicate.clone().subst(parameters); |
939 | if let Some(obligation) = Obligation::from_predicate(predicate) { | 940 | if let Some(obligation) = Obligation::from_predicate(predicate) { |