-
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
E0053 needs tighter spans #35212
Comments
Okay, this isn't quite easy at all. I originally thought of simply grabbing the My initial solution to this problem was to add a |
Yeah, I'm also not a fan of adding the spans to |
Note to self: look into |
Niiiice. Looking forward to this fix. |
Here's what I've managed to do: Originally I thought of refactoring The implementation that I currently have has bugs though, watch what happens when I have two arguments - one I'm not sure if what I have is OK for submission right now, or whether I should just remove the shortened span for the latter case, and replace it with the whole line span. |
Oh, nevermind. I think the answer is pretty obvious. E0050 already checks for whether the trait fn and the impl fn have the same number of arguments, and is done before checking for E0053, so the number of arguments for the trait fn and the impl fn are guaranteed to be the same. This means if I simply obtain the iterator for both argument vectors and zip them, comparing only their mutability until I find one that does not match, I would have found the index for the two arguments. |
…rner Additional span info for E0053 Part of rust-lang#35233. Fixes rust-lang#35212. r? @jonathandturner
From: src/test/compile-fail/E0053.rs
Some bonus tasks on this one:
Error E0053 currently is updated to the new error format, but the spans are very large. Ideally, instead of this:
We could have smaller spans (with updated labels):
It would also be great to show what the other definition was:
The text was updated successfully, but these errors were encountered: