Skip to content

Commit 57de750

Browse files
committed
When calling a method on Fn* traits explicitly, argument diagnostics should
point at the called method (eg Fn::call_once), not the underlying callee. Fixes 128848
1 parent 8c0ec05 commit 57de750

File tree

5 files changed

+245
-201
lines changed

5 files changed

+245
-201
lines changed

compiler/rustc_hir_typeck/src/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(crate) fn check_legal_trait_for_method_call(
5858
enum CallStep<'tcx> {
5959
Builtin(Ty<'tcx>),
6060
DeferredClosure(LocalDefId, ty::FnSig<'tcx>),
61-
/// E.g., enum variant constructors.
61+
/// Call overloading when callee implements one of the Fn* traits.
6262
Overloaded(MethodCallee<'tcx>),
6363
}
6464

0 commit comments

Comments
 (0)