-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
add error message for c# style named arguments #118733
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
I ran the rebase command, why is there a conflict still? |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to fix all these merge conflicts. You'll probably have the best success by just blessing all the tests over again: ./x.py test tests/ui --bless
.
Then please squash all of your commits into one.
Okay, I think I did everything right. I have a single commit with blessed tests and the code I intended to add. However, some tests are still failing and I cannot understand why. |
Actually, now that I look at the test output changes, I wonder if this is not the right place to put this code. This seems to step on the recovery for the old "type ascription" feature, I'm not sure if I have a good solution for this off the top of my head. I recommend reading the parser code for function arg parsing more closely to see if there's a better place to put this. Sorry for the churn 😅 but that's just how working in the parser is sometimes. |
@/estebank had suggested a solution of trying to parse a type after a snapshot is taken. Is there a way this could be used? |
This comment has been minimized.
This comment has been minimized.
help: if `monad_bind` is a struct, use braces as delimiters | ||
| ^ expected identifier | ||
| | ||
LL | let my = monad_bind { mx, T: Try }; | ||
| ~ ~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still sad of losing this suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible for me to add on this suggestion along with the named arguments error? something like -
if this is a parameter, remove the parameter name
...
if this is a struct, use braces as delimiters
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you could likely include it to. Look at the existing one because there's some subtlety here: this suggestion is only potentially valid if all the previous expressions in the argument list are either an ident (like mx
) or the type ascription (which is no longer represented in the expression syntax tree, the T: Try
), so we only emit the that suggestion if when encountering the problem, all prior args are just idents. We would also want to remove the older logic as now it won't trigger anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, I'll take a look at the existing solution and try to adapt it to this. Can we go over other changes that should be made to get all the tests to pass?
The job Click to see the possible cause of the failure (guessed by this bot)
|
So, how should we move forward with this? |
@nouritsu any updates on this? thanks |
@Dylan-DPC this PR is awaiting a response from a reviewer. It cannot be merged because it messes up the error messages for type ascription. I'm not sure how to proceed with this, but my current solution is nowhere near ready to be merged. |
Hi @estebank, do you have suggestions for the author on how to proceed? |
☔ The latest upstream changes (presumably #127541) made this pull request unmergeable. Please resolve the merge conflicts. |
This is a duplicate of the now closed #118532
r? @estebank