-
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
Don't emit "is not a logical operator" error outside of associative expressions #75658
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthewjasper (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. |
r? @estebank Hi @estebank, thought you might be the best person to review, since you've touched this part of the code recently. Also, want to point out that, with this change, code like this...
...will no longer generate the suggestion to replace "and" with "&&". Oops, I'm mistaken. It doesn't show the parens suggestion. But it does show the exact same errors as before, sans the "and" -> "&&" suggestion. Not sure if this is a deal-breaker.
|
This looks good to me. Can you squash the two commits? r=me after that. |
That is unfortunate, but at the same time the code is far away from correct enough for us to accept the lack of helpful suggestions. |
…xpressions Avoid showing this error where it doesn't make sense by not assuming "and" and "or" were intended to mean "&&" and "||" until after we decide to continue parsing input as an associative expression. Note that the decision of whether or not to continue parsing input as an associative expression doesn't actually depend on this assumption. Fixes rust-lang#75599
c730200
to
ff73a40
Compare
Squashed the commits. Thanks @estebank. |
@bors r=estebank |
📌 Commit ff73a40 has been approved by |
Don't emit "is not a logical operator" error outside of associative expressions Avoid showing this error where it doesn't make sense by not assuming "and" and "or" were intended to mean "&&" and "||" until after we decide to continue parsing input as an associative expression. Note that the decision of whether or not to continue parsing input as an associative expression doesn't actually depend on this assumption. Fixes rust-lang#75599 --- First time contributor! Let me know if there are any conventions or policies I should be following that I missed here. Thanks :)
Don't emit "is not a logical operator" error outside of associative expressions Avoid showing this error where it doesn't make sense by not assuming "and" and "or" were intended to mean "&&" and "||" until after we decide to continue parsing input as an associative expression. Note that the decision of whether or not to continue parsing input as an associative expression doesn't actually depend on this assumption. Fixes rust-lang#75599 --- First time contributor! Let me know if there are any conventions or policies I should be following that I missed here. Thanks :)
Don't emit "is not a logical operator" error outside of associative expressions Avoid showing this error where it doesn't make sense by not assuming "and" and "or" were intended to mean "&&" and "||" until after we decide to continue parsing input as an associative expression. Note that the decision of whether or not to continue parsing input as an associative expression doesn't actually depend on this assumption. Fixes rust-lang#75599 --- First time contributor! Let me know if there are any conventions or policies I should be following that I missed here. Thanks :)
Rollup of 9 pull requests Successful merges: - rust-lang#75038 (See also X-Link mem::{swap, take, replace}) - rust-lang#75049 (docs(marker/copy): provide example for `&T` being `Copy`) - rust-lang#75499 (Fix documentation error) - rust-lang#75554 (Fix clashing_extern_declarations stack overflow for recursive types.) - rust-lang#75646 (Move to intra doc links for keyword documentation) - rust-lang#75652 (Resolve true and false as booleans) - rust-lang#75658 (Don't emit "is not a logical operator" error outside of associative expressions) - rust-lang#75665 (Add doc examples coverage) - rust-lang#75685 (Switch to intra-doc links in /src/sys/unix/ext/*.rs) Failed merges: r? @ghost
Avoid showing this error where it doesn't make sense by not assuming
"and" and "or" were intended to mean "&&" and "||" until after we decide
to continue parsing input as an associative expression.
Note that the decision of whether or not to continue parsing input as an
associative expression doesn't actually depend on this assumption.
Fixes #75599
First time contributor! Let me know if there are any conventions or policies I should be following that I missed here. Thanks :)