Wrong error message when Fn parameter doesn't match expected signature in call to function #45788
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
WG-diagnostics
Working group: Diagnostics
A minimal complete test case:
Attempting to compile this under nightly gives the following:
The error E0593 is correct, a function is expected to take 1 argument but it takes 2 arguments. But the "function" that is failing this expectation/test is not
takes_callback
but rathercallback
.The error message "expected function that takes 1 argument" in the diagram below the error points to
takes_callback
which definitely was not expected to take only one argument (since it takes two arguments,FnOnce
andT
).As best as I can tell, this error should be
The text was updated successfully, but these errors were encountered: