-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing error on mismatched argument count of function parameters #42855
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
Comments
Mark-Simulacrum
added
the
A-diagnostics
Area: Messages for errors, warnings, and lints
label
Jun 23, 2017
Mark-Simulacrum
added
the
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
label
Jul 26, 2017
bors
added a commit
that referenced
this issue
Dec 14, 2017
Point at whole method call instead of args To avoid confusion in cases where the code is ```rust fn foo() {} / foo( | bar() | ^^^ current diagnostics point here for arg count mismatch | ); |_^ new diagnostic span points here ``` as this leads to confusion making people think that the diagnostic is talking about `bar`'s arg count, not `foo`'s. Point at `fn`s definition on arg mismatch, just like we do for closures. Re #42855, Fix #45633.
Ideally it should also point at the |
This was referenced Sep 5, 2019
Centril
added a commit
to Centril/rust
that referenced
this issue
Sep 16, 2019
On obligation errors point at the unfulfilled binding when possible CC rust-lang#42855, rust-lang#64130, rust-lang#64135.
Centril
added a commit
to Centril/rust
that referenced
this issue
Sep 19, 2019
On obligation errors point at the unfulfilled binding when possible CC rust-lang#42855, rust-lang#64130, rust-lang#64135.
Centril
added a commit
to Centril/rust
that referenced
this issue
Sep 20, 2019
When possible point at argument causing item obligation failure Fix rust-lang#41781, fix rust-lang#42855, fix rust-lang#46658, fix rust-lang#48099, fix rust-lang#63143.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Example:
The problem is the second argument in the
bar
call (foo
) takes only one argument instead of the expected 2 arguments. However, the error looks like there is something wrong with the argument count of thebar
call:Error on nightly & beta:
Error on stable:
Instead, the
^^^
should point to the faulty argument:cc @oli-obk
The text was updated successfully, but these errors were encountered: