about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/util/call_kind.rs
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2021-12-29 17:05:54 +0800
committerDeadbeef <ent3rm4n@gmail.com>2022-02-12 19:24:43 +1100
commitd3acb9d00e64d68d8c91c9d9925b92cd79b33379 (patch)
tree44891fbd41e701febd1ffab7efb41a9a3891d870 /compiler/rustc_const_eval/src/util/call_kind.rs
parent6d6314f878bf489e15293498ecb4af082c8d53d8 (diff)
downloadrust-d3acb9d00e64d68d8c91c9d9925b92cd79b33379.tar.gz
rust-d3acb9d00e64d68d8c91c9d9925b92cd79b33379.zip
Handle Fn family trait call errror
Diffstat (limited to 'compiler/rustc_const_eval/src/util/call_kind.rs')
-rw-r--r--compiler/rustc_const_eval/src/util/call_kind.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/util/call_kind.rs b/compiler/rustc_const_eval/src/util/call_kind.rs
index fe35d942341..11bb9508a1f 100644
--- a/compiler/rustc_const_eval/src/util/call_kind.rs
+++ b/compiler/rustc_const_eval/src/util/call_kind.rs
@@ -44,7 +44,7 @@ pub enum CallKind<'tcx> {
         is_option_or_result: bool,
     },
     /// A call to `Fn(..)::call(..)`, desugared from `my_closure(a, b, c)`
-    FnCall(DefId),
+    FnCall { fn_trait_id: DefId, self_ty: Ty<'tcx> },
     /// A call to an operator trait, desuraged from operator syntax (e.g. `a << b`)
     Operator { self_arg: Option<Ident>, trait_id: DefId, self_ty: Ty<'tcx> },
     DerefCoercion {
@@ -85,7 +85,7 @@ pub fn call_kind<'tcx>(
     // an FnOnce call, an operator (e.g. `<<`), or a
     // deref coercion.
     let kind = if let Some(&trait_id) = fn_call {
-        Some(CallKind::FnCall(trait_id))
+        Some(CallKind::FnCall { fn_trait_id: trait_id, self_ty: method_substs.type_at(0) })
     } else if let Some(&trait_id) = operator {
         Some(CallKind::Operator { self_arg, trait_id, self_ty: method_substs.type_at(0) })
     } else if is_deref {