Add trait Fns to rust-call resolution

This commit is contained in:
Rune Tynan 2020-12-03 15:49:20 -05:00
parent 1f95c91c88
commit 7cece8eca3
No known key found for this signature in database
GPG Key ID: 7ECC932F8B2C731E

View File

@ -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),