-
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
Recover from accidental inclusion of if
in let else
#103791
Comments
I think the current suggestion is valid. So the suggestion if changed maybe fall-negative. |
We should likely add an alternative suggestion to remove the |
@rustbot claim |
What would be the best way to go about adding an alternate suggestion? I'd like to try my hand at this. What I think needs to be done is adding help text to Is this a good starting point? |
@hgrahamcs it sounds like you are in the right path. |
I looked a bit into this issue and have already found where to add text to the Does anyone have a hint for me? |
@rustbot claim |
@rustbot claim |
You can add I'm not sure about the specifics out of the top of my head here of what type each step in the parse is, but you will have successfully parsed the |
@rustbot claim |
…ntal-let-else, r=compiler-errors Add suggestion to remove if in let..else block Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let expression. This is likely that the user has accidentally mixed if-let and let..else together. Fixes rust-lang#103791.
Given the following code: link
The current output is:
Ideally the output should suggest removing the additional
if
keyword in front of thelet else
. This mistake can occur due to muscle memory asif
,if let
,let else
and in the futurelet chains
are somewhat similar syntactically. Thanks.@rustbot label +D-confusing +F-let-else
The text was updated successfully, but these errors were encountered: