Skip to content

implement StructuralPartialEq for MaybeDangling#154891

Open
WaffleLapkin wants to merge 1 commit intorust-lang:mainfrom
WaffleLapkin:deregress-manually-drop-matching
Open

implement StructuralPartialEq for MaybeDangling#154891
WaffleLapkin wants to merge 1 commit intorust-lang:mainfrom
WaffleLapkin:deregress-manually-drop-matching

Conversation

@WaffleLapkin
Copy link
Copy Markdown
Member

@WaffleLapkin WaffleLapkin commented Apr 6, 2026

This fixes -- a stable-to-stable regression where constants of type ManuallyDrop<T> would not be allowed to be used as a pattern due to MaybeDangling<T> in ManuallyDrop<T> not implementing StructuralPartialEq.

Fixes #154890

I'm sorry, @theemathas, I forgot to address your comment 😭

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 6, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 10 candidates

Copy link
Copy Markdown
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

r=me once CI passes

View changes since this review

This fixes a stable-to-stable regression where constants of type
`ManuallyDrop<T>` would not be allowed to be used as a pattern due to
`MaybeDangling<T>` in `ManuallyDrop<T>` not implementing
`StructuralPartialEq`.
@WaffleLapkin WaffleLapkin force-pushed the deregress-manually-drop-matching branch from 68bcf7c to d5f98fb Compare April 6, 2026 16:19
@Jules-Bertholet
Copy link
Copy Markdown
Contributor

Why not just derive(PartialEq, Eq, PartialOrd, Ord, Hash) for MaybeDangling? That way, ManuallyDrop can revert to derived impls also.

@Jules-Bertholet
Copy link
Copy Markdown
Contributor

Filed a PR: #154905

@WaffleLapkin
Copy link
Copy Markdown
Member Author

@bors r=JohnTitor

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 6, 2026

📌 Commit d5f98fb has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ManuallyDrop can't be used as a constant in match since 1.94

4 participants