Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement comparison of InvisibleOrigin without PartialEq #146090

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

Open
Kobzol wants to merge 1 commit into rust-lang:master
base: master
Choose a base branch
Loading
from Kobzol:invisible-origin-eq

Conversation

Copy link
Member

@Kobzol Kobzol commented Sep 1, 2025
edited
Loading

For #145354, we need PartialEq for TokenStream to "just work". However, due to the special comparison implementation that was used for InvisibleOrigin, this wasn't the case.

I found that InvisibleOrigin is stored in TokenKind and Delimiter variants. I removed PartialEq from them, and replaced all usages of == with an explicit comparison function. This function is probably not needed in all the cases, but I don't have enough domain knowledge to distinguish where it should be used or not.

I also added a panic to the PartialEq impl for Delimiter, just to make sure that invisible delimiters are never compared "normally". Let's see what happens on CI.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 1, 2025

This comment has been minimized.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 1, 2025
@Kobzol Kobzol marked this pull request as ready for review September 2, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /