-
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
Error reporting for missing match
comma could be improved
#29586
Comments
This is still occurring in the latest nightly. Would be nice to have this improvement because I've stumbled upon it several times. |
The parser should use
The suggestion (the |
Hello there, I'd like to try tackling this issue. It would be my first work on the compiler so I'll be slow, but I understand the issue and the mentoring instructions. |
Could anybody point me to a place where I can write tests for this, and maybe any tests that are similar to what I would need to write? Thanks in advance. |
@brainlessdeveloper the tests are all in |
So, I'm trying to make progress with this. I wrote the test and have its Correct me if I'm wrong, but I can't use
The rest of the work should be checking for errors during Afterwards, there's this logic:
I'm not sure if I can reuse this or if it should be removed and handled differently depending on whether the arm has braces or not. |
@brainlessdeveloper, that is correct and the appropriate way of doing looking for something that might not be there.
You can use
I don't know if you can use it as I think that the failure happens on the previous line and that in that case the method returns. If that is not the case, then |
With your help I managed to show a note in the appropriate cases - now I have to figure out which method is the one I need to use to show the note properly because it should also point to where the missing comma should be added. I should be able to work on this further during the coming weekend :). |
@brainlessdeveloper I'm glad I could be of help! If you feel comfortable with the code you have so far, feel free to post a PR for the new labels, referencing this issue (but not closing it), and posting a follow up PR adding the suggestion when you have the time. |
The code is terrible - I increased the size of the method by 80% and the suggestion note does not come up where it should - I'll take some time to go over it first in the next days :) |
UPDATE: Mentoring instructions below.
Given this code:
rustc
reports this error:As @mbrubeck pointed out in IRC, the cause is that a bitwise-and operation, namely
"art" & Foo::B
is being parsed.The text was updated successfully, but these errors were encountered: