Skip to content

Commit

Permalink
When calling a method on Fn* traits explicitly, argument diagnostics …
Browse files Browse the repository at this point in the history
…should

point at the called method (eg Fn::call_once), not the underlying callee.

Fixes 128848
  • Loading branch information
jder committed Sep 13, 2024
1 parent 8c0ec05 commit 57de750
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 201 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub(crate) fn check_legal_trait_for_method_call(
enum CallStep<'tcx> {
Builtin(Ty<'tcx>),
DeferredClosure(LocalDefId, ty::FnSig<'tcx>),
/// E.g., enum variant constructors.
/// Call overloading when callee implements one of the Fn* traits.
Overloaded(MethodCallee<'tcx>),
}

Expand Down
Loading

0 comments on commit 57de750

Please sign in to comment.