-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"snippet" for "did you mean x
" is not so helpful
#36164
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Another possibility is to actually replace it
But if it's only a guess, that might not be a good idea. |
@durka my inclination is that the extra 5 lines of output aren't valuable enough in this case, it's not likely it's tricky to figure out how to apply the change |
Or maybe even...
|
@jonathandturner how is that different from my 3rd example? (Except for using a longer "error' message) |
@nikomatsakis - lol are you sure you didn't add it after I commented? Just kidding, I just didn't see it the first time through. |
My vote is your # 3 ;) |
I'm happy to mentor the change. It seems like it would be fairly self-contained. The error is reported by this code in The idea would be to
I think that will basically do it! |
One wrinkle I am not sure about: the changes that I suggested above will, iirc, cause a |
Yes, a default label would be great when we don't know the name. Maybe something like "^^^^ unknown field" when we don't know of a good suggestion |
I'd love to try my hand at this. The instructions posted seem sufficient for now, but I'll come back if I have any questions. |
@aravind-pg Are you still working on this? |
Sorry, I just haven't found time for this unfortunately. You can go ahead and un-assign me. |
- Fixes rust-lang#36164 - Part of rust-lang#35233 - handles unknown fields - uses UI-style tests - update all related tests (cfail, ui, incremental)
Improve error message and snippet for "did you mean `x`" - Fixes rust-lang#36164 - Part of rust-lang#35233 Based on the standalone example https://is.gd/8STXMd posted by @nikomatsakis and using the third formatting option mentioned in rust-lang#36164 and agreed by @jonathandturner. Note however this does not address the question of [how to handle an empty or unknown suggestion](rust-lang#36164 (comment)). @nikomatsakis any suggestions on how best to address that part?
On current beta, at least, I see:
But I feel like I'd rather see:
Come to think of it, we could shorten the main message and move the suggestion into the label, as I think you've done elsewhere:
Standalone example:
https://is.gd/8STXMd
cc @jonathandturner
The text was updated successfully, but these errors were encountered: