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

suggest `|` when `,` founds in invalid match value #57008

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
6 participants
@Knium
Copy link

Knium commented Dec 20, 2018

Issue #54807
I get stuck on (what | how) I should implement...

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 20, 2018

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Knium Knium changed the title suggest `|` when `,` founds in invalid match arms suggest `|` when `,` founds in invalid match value Dec 20, 2018

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 20, 2018

You need to update some tests and commit the changes. You can do this via

./x.py test --stage 1 src/test/ui --bless

and adjust the errors at the file:line locations mentioned in the errors until the command passes successfully

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 20, 2018

The current behavior is intentional and has reasons, as it was mentioned in #54807.
In some very popular languages like Python tuples can be written without parentheses (A, B) <=> A, B, so it's reasonable to expect that the user could actually mean (A, B) when writing A, B.

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 21, 2018

As I mentioned in #54807 (comment), I believe it would be cool to suggest both (A, B) and A | B. Do you think doing so will complicate the parser more than it's worth it for such a small suggestion?

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 21, 2018

Suggesting both would be ok, the change will need to be done in fn parse_top_level_pat then.
It will give some false positives like recommending let A | B = expr;, but that doesn't matter much, it will become legal soon, at least in the parser.

@Knium

This comment has been minimized.

Copy link

Knium commented Dec 26, 2018

Hi, thanks for reviewing! I need solid blocks of time to understand what you mean and implement. So just a moment pls :)

@Aaronepower

This comment has been minimized.

Copy link
Contributor

Aaronepower commented Jan 11, 2019

Triage; @Knium Hello, have you been able to get back to this PR?

@Knium

This comment has been minimized.

Copy link

Knium commented Jan 13, 2019

@Aaronepower Hi, thank you for reminding! Sorry, I'm busier than I thought... If this issue has hurry deadline or there is anyone who want to solve, I approve that someone takes my place. If no one else, I'm still eager to challenge this.

@TimNN

This comment has been minimized.

Copy link
Contributor

TimNN commented Jan 22, 2019

Ping from triage @Knium:

Sorry, I'm busier than I thought... If this issue has hurry deadline or there is anyone who want to solve, I approve that someone takes my place.

Don't worry, there is no deadline :). We just like to check in on PRs ~regularly so that we don't have dozens of PRs open that are not being worked on. If you are interested, you can find more information here: https://forge.rust-lang.org/triage-procedure.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment