diff options
author | Florian Diebold <[email protected]> | 2021-03-13 16:55:50 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-13 16:56:48 +0000 |
commit | 9719ce9fc731a400c9744ba1a6569e978c1a97e7 (patch) | |
tree | a9c674c83723e2ed145793f72450c873da62a6fc /crates/hir_ty/src/infer | |
parent | 19664e276aba21a42cad5351a2c91995d1ce5d52 (diff) |
Use chalk_ir::FnDefId
Diffstat (limited to 'crates/hir_ty/src/infer')
-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) { |