Skip to content

Make SpanlessEq more consistent #11736

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

Merged
merged 5 commits into from
Nov 8, 2023
Merged

Conversation

gernot-ohner
Copy link

@gernot-ohner gernot-ohner commented Oct 30, 2023

  1. Remove wildcard as requested in Make SpanlessEq more consistent #10267.
  2. Implement hir_utils::eq_expr for ExprKind::Closure, ExprKind::ConstBlock, ExprKind::InlineAsm and ExprKind::Yield.
  3. Reorder branches of hir_utils::eq_expr to be in alphabetical order.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2023

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

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 30, 2023
@flip1995 flip1995 changed the title Issue 10267 Make SpanlessEq more consistent Oct 31, 2023
@flip1995
Copy link
Member

flip1995 commented Nov 2, 2023

This LGTM overall. It even uncovered an unimplemented kind IIUC. Is there a reason why this is still in draft mode?

If you want you can do the same for the SpanlessHash implementation of Expr. They should be always in sync anyway.

@gernot-ohner gernot-ohner marked this pull request as ready for review November 4, 2023 18:03
@gernot-ohner
Copy link
Author

Thanks for the review!

I wasn't sure whether the implementation of the branch for Yield was correct in ignoring comparing the expression and ignoring the YieldSource. My impression is that that's correct, but I'd defer to your opinion here.

I'm also unsure what the preferred procedure is: Should I create another PR for the changes in SpanlessHash or it in this one?

@dswij
Copy link
Member

dswij commented Nov 6, 2023

I'm also unsure what the preferred procedure is: Should I create another PR for the changes in SpanlessHash or it in this one?

If the scope isn't too big, and it's (kinda) related like this one, I'd say it's fine to do it in one PR.

But doing it in separate PRs is not really a problem as well

Just let us know :)

@gernot-ohner
Copy link
Author

In that case, I'd like to do it in a separate PR.
Is this PR ready to be merged then? Or would you like to have anything else done here?

@flip1995
Copy link
Member

flip1995 commented Nov 6, 2023

Should I create another PR for the changes in SpanlessHash or it in this one?

As the implementations of Hash an Eq should always agree (std::Hash), I'd prefer to do this as an additional commit in this PR.

Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed that hash_expr already was complete. Thanks for doing the plumbing work of sorting it anyway.

@flip1995
Copy link
Member

flip1995 commented Nov 8, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Nov 8, 2023

📌 Commit 171845d has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 8, 2023

⌛ Testing commit 171845d with merge ba43632...

@bors
Copy link
Contributor

bors commented Nov 8, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing ba43632 to master...

@bors bors merged commit ba43632 into rust-lang:master Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants