Skip to content

Commit ec9a6a6

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 4fe1e2b commit ec9a6a6

File tree

4 files changed

+246
-196
lines changed

4 files changed

+246
-196
lines changed

compiler/rustc_hir_typeck/src/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn check_legal_trait_for_method_call(
5757
enum CallStep<'tcx> {
5858
Builtin(Ty<'tcx>),
5959
DeferredClosure(LocalDefId, ty::FnSig<'tcx>),
60-
/// E.g., enum variant constructors.
60+
/// Call overloading when callee implements one of the Fn* traits.
6161
Overloaded(MethodCallee<'tcx>),
6262
}
6363

0 commit comments

Comments
 (0)