rust-lang / rust-lang/rust-bindgen

PartialOrd for opaque?

Open
#1,013 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug I-unclear
Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

In #882 (PR #1002) we used PartialEq analysis to analyse whether we can derive PartialOrd. Generally this makes sense because if PartialEq can be derived then PartialOrd can be derived too.

But there is a problem. I can imagine what means for opaque types to be PartialEq: we just have to compare byte-by-byte both blobs. But I have a problem imaging what we should do in case of PartialOrd: compare each byte in both blobs?

Maybe we should split result of the analysis and explicitly state whether we can derive PartialOrd or not?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the PartialEq analysis discussed in #882 and implemented in PR #1002, focusing on how it is used to assess PartialOrd derivation for opaque types. Determine and document the intended ordering semantics and whether the analysis must distinguish PartialEq from PartialOrd. Done means the project has an agreed direction for handling opaque PartialOrd support.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.