Skip to content

Recover on invalid operators <> and <=> #91597

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

ghost
Copy link

@ghost ghost commented Dec 6, 2021

Thanks to #89871 for showing me how to do this.
Next, I think it'd be nice to recover on <=> too, like #89871 intended, if this even works.

@rust-highfive
Copy link
Contributor

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 6, 2021
@leonardo-m
Copy link

In the end rustc will understand (and refuse) the syntax of most other languages... :-)

@ghost
Copy link
Author

ghost commented Dec 6, 2021

@leonardo-m

In the end rustc will understand (and refuse) the syntax of most other languages... :-)

Right, so you are saying something along the lines of "it doesn't make much sense to add this if we don't suggest a match for a switch etc." right? Yeah I get your logic/point and I tend to agree but then I wonder why suggestions exist for !== and ===: https://github.com/rust-lang/rust/blob/a0585d8f2ca537ab6ca1e26aa741c281ff0bdc6b/compiler/rustc_parse/src/parser/expr.rs#L216-L236
Should these be removed too?

@leonardo-m
Copy link

I'm not opposed to this pull. It was humor.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ghost ghost changed the title Recover on invalid operator <> Recover on invalid operators <> and <=> Dec 8, 2021
@rust-log-analyzer

This comment has been minimized.

@ghost ghost force-pushed the lessthangreaterthan branch from 203c81d to 1c56648 Compare December 8, 2021 16:40
@rust-log-analyzer

This comment has been minimized.

@ghost ghost force-pushed the lessthangreaterthan branch from 4c201e6 to c83d36f Compare December 8, 2021 17:32
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 9, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@michaelwoerister
Copy link
Member

Thanks for the PR, @r00ster91! Looks useful to me.

I think this is best reviewed by someone from the diagnostic working group.

r? rust-lang/diagnostics

@oli-obk
Copy link
Contributor

oli-obk commented Dec 14, 2021

The changes lgtm.

Please squash the commits into a single one

r=me with that

@ghost ghost force-pushed the lessthangreaterthan branch from 4782262 to f194c9b Compare December 14, 2021 17:08
@ghost
Copy link
Author

ghost commented Dec 14, 2021

r=oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Dec 14, 2021

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 14, 2021

📌 Commit f194c9b has been approved by oli-obk

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 14, 2021
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 14, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2021
…i-obk

Recover on invalid operators `<>` and `<=>`

Thanks to rust-lang#89871 for showing me how to do this.
Next, I think it'd be nice to recover on `<=>` too, like rust-lang#89871 intended, if this even works.
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2021
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#89825 (Make split_inclusive() on an empty slice yield an empty output)
 - rust-lang#91239 (regression test for issue 87490)
 - rust-lang#91597 (Recover on invalid operators `<>` and `<=>`)
 - rust-lang#91774 (Fix typo for MutVisitor)
 - rust-lang#91786 (Return an error when `eval_rvalue_with_identities` fails)
 - rust-lang#91798 (Avoid suggest adding `self` in visibility spec)
 - rust-lang#91856 (Looser check for overflowing_binary_op)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4b37cfc into rust-lang:master Dec 15, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants