From 7cece8eca3fa42f93c53acfc1d376077025126f2 Mon Sep 17 00:00:00 2001 From: Rune Tynan Date: Thu, 3 Dec 2020 15:49:20 -0500 Subject: [PATCH] Add trait Fns to rust-call resolution --- compiler/rustc_typeck/src/check/check.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_typeck/src/check/check.rs b/compiler/rustc_typeck/src/check/check.rs index 489d836298f8..a4b21e96f05f 100644 --- a/compiler/rustc_typeck/src/check/check.rs +++ b/compiler/rustc_typeck/src/check/check.rs @@ -103,6 +103,9 @@ pub(super) fn check_fn<'a, 'tcx>( Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Fn(header, ..), .. }) => Some(header), + Node::TraitItem(hir::TraitItem { + kind: hir::TraitItemKind::Fn(header, .. ), .. + }) => Some(header), // Closures are RustCall, but they tuple their arguments, so shouldn't be checked Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => None, node => bug!("Item being checked wasn't a function/closure: {:?}", node),