Skip to content

Update PartialEq/PartialOrd guarantees for comparisons to match reality - #164473

Open
clarfonthey wants to merge 1 commit into
rust-lang:mainfrom
clarfonthey:transitivity
Open

clarfonthey wants to merge 1 commit into
rust-lang:mainfrom
clarfonthey:transitivity

Conversation

@clarfonthey

@clarfonthey clarfonthey commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

This fixes #164470 and #164184 by making our guarantees match reality

Note that this is a guarantee change and thus requires FCP, however, we have to do something since currently the standard library conflicts with its own recommendations.

Transitivity across types

Essentially, while we had all the ingredients to understand this in 1.0.0, we kinda blew it by adding the invalid transitive impls in 1.8.0: in particular, the comparison PartialEq<str> for Path breaks this condition, and this is trivial to prove by comparing "test" == Path::new("./test") and Path::new("./test") == "./test", which does not imply "test" == "./test".

Pedantry note: 1.8.0 added PartialEq<OsStr> for Path, and PartialEq<str> for Path was added much later. However, PartialEq<str> for Path is easier to write, so, I used that one as an example here.

Considering how the Borrow trait kind of saw through this problem and was part of 1.0, I suggest we simply relax the guarantees to not require transitivity across different types unless Borrow is implemented for them, in which case the transitivity is added back in. This effectively matches the intuition for what libs thinks these types do, but actually makes it a reality.

Definition of partial order

Currently, Rust's definition of a partial order is subtly incorrect, due to a misconception that partial orders are consistent with partial equivalence relations. It tries to act like this is just a weak partial order instead of a strict one, but in fact, the weakness and strictness only depend on whether the axioms are defined for <= or <. This is the issue brought up in #164184.

This changes the axioms we offer to explicitly mention that: actually, what Rust offers is a strict partial ordering. The full list of changes is complicated and I would recommend just reading the new requirements in isolation and see if they're correct.

Rendering

For easy reading, here are both the new relevant docs for Borrow, PartialEq, and PartialOrd.

Borrow

Additionally, if PartialEq and PartialOrd allow comparisons between types and their borrowed versions, those comparisons must allow the user to satisfy all the relevant transitive requirements of these traits, e.g.x.borrow() == y and y == z.borrow() should imply x == z as well.

PartialEq

For any type A: PartialEq, the equality relation == must satisfy the following condition:

  • Transitivity: for all a, b, c of type A, a == b and b == c implies a == c. This must also work for longer chains.

For any given combination of A and B where A: PartialEq<B> and B: PartialEq<A>, the equality relation == must additionally satisfy the following condition:

  • Symmetry: for all a of type A and b of type B, a == b implies b == a. This also means that this case applies for A == B.

Note that the for any given A: PartialEq<B> impl, the symmetric B: PartialEq<A> impl is not forced to exist, but these requirements apply whenever they do exist.

Note that transitivity for more than one type is not guaranteed. For any given combination of A, B, and C where A: PartialEq<B> and B: PartialEq<C>, the following may not hold:

  • Transitivity: for all a of type A, b of type B, and c of type C, a == b and b == c does not imply a == c.

Note that types are allowed to be transitive in this method, but it is not strictly required. If you want stronger guarantees across types, you should use conversions like Borrow to convert everything to the same type before comparing.

Violating these requirements is a logic error. The behavior resulting from a logic error is not specified, but users of the trait must ensure that such logic errors do not result in undefined behavior. This means that unsafe code must not rely on the correctness of these methods.

PartialOrd

For any type A: PartialOrd, the ordering must satisfy the following conditions:

  • Irreflexivity: for all a of type A, !(a < a) and !(a > a).
  • Transitivity: for all a, b, c of type A, a < b and b < c implies a < c. This must also work for longer chains and all operators, namely <=, ==, >=, and >.

There is also a third property guaranteed by the signature of partial_cmp itself:

  • Uniqueness: for all a, b of type A, at most one of a < b, a == b, or a > b.

For any given combination of A and B where A: PartialOrd<B> and B: PartialOrd<A>, the ordering must additionally satisfy the following condition:

  • Duality: for all a of type A and b of type B, a < b if and only if b > a.

Note that the for any given A: PartialOrd<B> impl, the symmetric B: PartialOrd<A> impl is not forced to exist, but these requirements apply whenever they do exist.

Note that transitivity for more than one type is not guaranteed. For any given combination of A, B, and C where A: PartialEq<B> and B: PartialEq<C>, the following may not hold:

  • Transitivity: for all a of type A, b of type B, and c of type C, a < b and b < c does not imply a < c. This similarly is not guaranteed for the operators <=, ==, >=, and >.

Note that types are allowed to be transitive in this method, but it is not strictly required. If you want stronger guarantees across types, you should use conversions like Borrow to convert everything to the same type before comparing.

Violating these requirements is a logic error. The behavior resulting from a logic error is not specified, but users of the trait must ensure that such logic errors do not result in undefined behavior. This means that unsafe code must not rely on the correctness of these methods.

Definition of partial order

In general, the definition of a partial order can be pretty confusing because of how people tend to conflate equality (the == operator) with identity (literally being the same value), whereas these two are not treated the same in Rust's definition. In particular, Rust satisfies the rules for a strict partial order which is defined in terms of <, but not a weak partial order which is defined in terms of <=.

In general, weak partial orderings will guarantee reflexivity, which Rust's PartialOrd explicitly does not guarantee:

  • Reflexivity: for all a of type A, PartialOrd does not guarantee a <= a or a >= a.

Here, the strictness of PartialOrd has nothing to do with the actual ordering, so much as the definition of ordering being based upon the < or <= operators, and the usual intuition for those operators. We match the intuition for <, but not that for <=. However, despite this, one important intuitive property of PartialOrd holds:

  • Substitutability: if a == b, then for any given logical formula containing only logical operators and ordering relations (<, <=, ==, >=, >) you can replace a with b without changing its meaning, and similarly replacing b with a.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 17, 2026
@rustbot

rustbot commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

r? @aapoalas

rustbot has assigned @aapoalas.
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: libs
  • libs expanded to 12 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, aapoalas

@clarfonthey

Copy link
Copy Markdown
Contributor Author

@rfcbot merge libs

@rust-rfcbot

rust-rfcbot commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

@clarfonthey has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/libs-ping: FCP proposed for libs, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Oct 17, 2026
Comment thread library/core/src/cmp.rs
/// be consistent with `PartialEq` (see the documentation of those traits for the exact
/// requirements). It's easy to accidentally make them disagree by deriving some of the traits and
/// manually implementing others.
/// If [`PartialOrd`] is also implemented for `Self` and `Rhs`, their methods must also be

@clarfonthey clarfonthey Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed mention of Ord here since, well, Ord can't take an Rhs, so, this is just confusing.

View changes since the review

@maxdexh

maxdexh commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Essentially, while we had all the ingredients to understand this in 1.0.0, we kinda blew it by adding the invalid transitive impls in 1.8.0: in particular, the comparison PartialEq<str> for Path breaks this condition

The OsStr impls were the ones that broke it in 1.8.0. The str impls are 1.91.

@clarfonthey

Copy link
Copy Markdown
Contributor Author

Thank you, operational pedantics. I saw that, but chose to use str because it's less syntax, but yes, the OsStr impl is the earliest point of breakage.

@clarfonthey

Copy link
Copy Markdown
Contributor Author

What I find particularly funny is that all of those conversations happened after the intransitive impl was added to std…

@the8472

the8472 commented Oct 17, 2026

Copy link
Copy Markdown
Member

Well, maybe it's the path Eq impl that's wrong and we should run normalization?

@clarfonthey clarfonthey added the I-libs-nominated Nominated for discussion during a libs team meeting. label Oct 17, 2026
@maxdexh

maxdexh commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Well, maybe it's the path Eq impl that's wrong and we should run normalization?

The PartialEq<str> for Path (and vice-versa) impl ignores trailing separators (among other things), and that is already enough to make it inconsistent with PartialEq<str> for str in a str == Path == str chain. The only way to make the impls compatible with each other would be to do no normalization, i.e. to compare the bytes of the path instead.
(Note: I'm not saying that this should be done, it would be a drastic change in behavior. I think this PR is the right approach)

@the8472

the8472 commented Oct 17, 2026

Copy link
Copy Markdown
Member

Ah yeah we shouldn't have had both of PartialEq<Path> for str and impl PartialEq<str> for Path, then the transitivity rule wouldn't apply.

@rust-log-analyzer

This comment has been minimized.

Comment thread library/core/src/cmp.rs Resolved
@clarfonthey clarfonthey removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Oct 20, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor Author

General discussion post-meeting was: this is the intersection of a bunch of compromises, and we have FCP.

@theemathas

Copy link
Copy Markdown
Contributor

Does #164184 interact with this?

@clarfonthey

Copy link
Copy Markdown
Contributor Author

My understanding is no @theemathas since this only changes the interaction between types, not the requirements for a single type, but I'd still like to wrap my head around what's being said regardless so we can bundle together the various changes to these traits in one FCP if we can.

@clarfonthey

Copy link
Copy Markdown
Contributor Author

cc @rust-lang/libs-ping #164184 made it clear that our definition of a partial order is just wrong in subtle ways, and I've taken the liberty of updating it to match what people actually do in practice. This also explicitly declares the implementation example in #164184 to be logically incorrect.

Since we're deciding to change the guarantees for these traits, I've decided that they should really all be done in one FCP so that we're certain what we're actually guaranteeing. Instead of restarting FCP, however, I've just unchecked everyone's boxes so that we can make it clear that people have actually looked at the new definition and are happy with it.

I've also taken the liberty of copying the relevant sections of the docs into the PR description so they can be read more easily than the diff, since this is effectively a rewrite, and the diff just makes it look more confusing.

@clarfonthey clarfonthey changed the title Update transitivity guarantees for comparisons to match reality Update PartialEq/PartialOrd guarantees for comparisons to match reality Oct 22, 2026
@clarfonthey clarfonthey added the I-libs-nominated Nominated for discussion during a libs team meeting. label Oct 22, 2026
@thomcc

thomcc commented Oct 25, 2026

Copy link
Copy Markdown
Member

@rfcbot merge libs

@rust-rfcbot

rust-rfcbot commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

@thomcc has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/libs-ping: FCP proposed for libs, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Oct 25, 2026
@clarfonthey clarfonthey removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Nov 2, 2026
Comment thread library/core/src/cmp.rs
/* compiler built-in */
}

/// Trait for types that form a [partial order](https://en.wikipedia.org/wiki/Partial_order).

@Muon Muon Nov 8, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be changed - just "partial order" means the non-strict variety. With reference to discussion in #140779 (comment) I suggest saying that it's for overloading the comparison operators.

View changes since the review

Comment thread library/core/src/cmp.rs
Comment on lines +1287 to +1289
/// * **Substitutability**: if `a == b`, then for any given logical formula containing only logical
/// operators and ordering relations (`<`, `<=`, `==`, `>=`, `>`) you can replace `a` with `b`
/// without changing its meaning, and similarly replacing `b` with `a`.

@Muon Muon Nov 8, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is actually meant to be a new requirement, right? I don't think it follows from the conditions in the previous section since the example of #164184 still goes through if it's just them.

Also, there's no need to mention logical formulas or operators. It's enough to say that a == b implies that a can be replaced with b in every comparison.

View changes since the review

@maxdexh maxdexh Nov 8, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pretty sure it does follow, it's not as strong of a statement as it first seems, and should pretty much already follow from everything being transitive

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reason why I mention logical operators and comparisons is because we can't make the guarantee that it applies for all code, just specifically code that involves comparisons.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pretty sure it does follow, it's not as strong of a statement as it first seems, and should pretty much already follow from everything being transitive

Except, as I said, the example from the #164184 still meets the requirements of the first section in this PR. Transitivity just gives you that a < b && b < c implies a < c. You need something extra to get that a == b && b < c implies a < c, because == is not identity.

The reason why I mention logical operators and comparisons is because we can't make the guarantee that it applies for all code, just specifically code that involves comparisons.

I agree? Just we only need to talk about results of comparisons. No need to bring up logical formulas and operators, because that falls out automatically.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this adds new axioms it should be up above where the axioms are listed, not hidden in a later section. If not, then it should explicitly state that this follows from the other axioms.

@Muon Muon Nov 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That breaks transitivity of <=: A1 <= A2 && A2 <= B implies A1 <= B.

But we don't have transitivity of <=. We just kinda expect it to fall out of defining a <= b as "either a < b or a == b".

You can have < really be a strict partial order and == really be a partial equivalence relation, and you can also say that you can't have both x < y and x == y, but those together still don't always give a transitive <=.

Counterexample: say we have 3 elements A, B, C:

  1. Define < exactly by B < C.
  2. Define == exactly by A == B, B == A, A == A, B == B.

Then each of the requirements are satisfied:

  1. < is irreflexive, asymmetric, and transitive and therefore a strict partial order.
  2. == is transitive and symmetric, and therefore a partial equivalence relation.
  3. It is never the case that both x < y and x == y, because we don't have B == C.

But from the definition of <=, it comes out true in exactly these cases: B <= C, A <= B, B <= A, A <= A, B <= B.

So we have A <= B and B <= C but not A <= C.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Transitivity of <= is explicitly added to the new requirements.

@Muon Muon Nov 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"[...] all operators, namely <=, ==, >=, and >."

Oh, I see, maybe it's just me, but that seems a bit hidden. The transitivity of <= is actually the most important one, because you can't derive it, unlike the transitivity of <. (Proof below.)

Details

Proposition. Let < be asymmetric, let == be symmetric, and let <= be their union. If < and == are disjoint and <= is transitive, then < is transitive.

Proof. Suppose the conditions hold and suppose a < b and b < c. We have a <= c by the definition and transitivity of <=, and hence either a < c or a == c by definition. Suppose to the contrary that a == c. Then c == a by symmetry and hence c <= a by definition, so b <= a by transitivity. Therefore either b < a or b == a, but:

  1. Since < is asymmetric, we cannot have b < a.
  2. Since < and == are disjoint and == is symmetric, similarly we cannot have b == a.

This is a contradiction, so we must have a < c. ∎

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I realised after this discussion that the substitutability axiom is a direct corollary of <= being transitive. It's a load-bearing requirement, so, I should clarify that more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could also derive transitivity of <= from transitivity of < and == plus these substitutivity axioms (proof below):

  1. If x == y, then x < z if and only if y < z.
  2. If x == y, then z < x if and only if z < y.
Details

Proposition. Let == be transitive, let < be transitive and obey the above axioms. Let <= be the union of == and <. Then <= is transitive.
Proof. Suppose a <= b and b <= c. We have four cases:

  1. a < b and b < c: we get a < c by transitivity of <.
  2. a == b and b == c: we get a == c by transitivity of ==.
  3. a == b and b < c: since a == b, axiom 1 gives a < c if and only if b < c. Therefore a < c.
  4. a < b and b == c: since b == c, axiom 2 gives a < b if and only if a < c. Therefore a < c.

Therefore either a == c or a < c in all cases, so a <= c. ∎

@clarfonthey clarfonthey linked an issue Nov 8, 2026 that may be closed by this pull request
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Nov 11, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

Comment thread library/core/src/cmp.rs Resolved
Comment thread library/core/src/cmp.rs
/// to conflate *equality* (the `==` operator) with *identity* (literally being the same value),
/// whereas these two are not treated the same in Rust's definition. In particular, Rust satisfies
/// the rules for a *strict partial order* which is defined in terms of `<`, but not a *weak partial
/// order* which is defined in terms of `<=`.

@RalfJung RalfJung Nov 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This text seems to be quite confused about =. First of all, "being the same value" is not defined.
Secondly, also in math it's not uncommon to use an equivalence relation rather than the default mathematical notion of equality. Being a weak partial order wrt to an equivalence relation is an entirely reasonable notion.

So to me the old text here seems more correct and understandable than the new text, I have to say.

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be worth mentioning that Eq + PartialOrd actually gives us a weak partial order (wrt the equivalence relation defined by Eq)? In fact the entire story might become more understandable if we set it up around that fact:

  • on its own PartialOrd does not make <= a weak partial order because we don't have reflexivity
  • but Eq + PartialOrd makes <= a weak partial order

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, to be clear part of rewriting this involved breaking my own inherent misconceptions regarding what the different types of partial orders are and what we're trying to do.

I guess that "same value" semantics are kind of muddied by the fact that PartialEq technically can use the addresses, but absolutely should not. But I do mean bit-identical values here, which is well-defined.

Comment thread library/core/src/cmp.rs
Comment on lines +1235 to +1237
/// - **Transitivity**: for all `a`, `b`, `c` of type `A`,
/// **`a < b` and `b < c` implies `a < c`**. This must also work for longer chains and
/// all operators, namely `<=`, `==`, `>=`, and `>`.

@RalfJung RalfJung Nov 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be read in two different ways:

  • the other operators are transitive
  • we can form chains mixing different operations

We actually do need the latter for some combination of operators, but obviously not all of them, so we probably have to be more precise here.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, did not mean to say that it works for all combinations, just that this transitivity relation applies when you substitute a < b && b < c to replace < with any of the other four operators.

Comment thread library/core/src/cmp.rs
Comment on lines +1282 to +1283
/// Here, the strictness of `PartialOrd` has nothing to do with the actual *ordering*, so much as
/// the *definition* of ordering being based upon the `<` or `<=` operators, and the usual intuition

@RalfJung RalfJung Nov 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know what the first sentence here is trying to say.

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this about this part from the PR description?

It tries to act like this is just a weak partial order instead of a strict one, but in fact, the weakness and strictness only depend on whether the axioms are defined for <= or <

That's correct but only half the story. It's also the case that the axioms for weak partial orders assume some underlying equivalence relation, which we simply don't have without Eq. Strict partial orders neatly generalize to sets without an equivalence relation, weak partial orders don't. That's why < forms a strict partial order but <= does not form a weak partial order (without Eq).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I really should just go back and just list the axioms I'm talking about rather than walking around that. I'll do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gonna I think solve that by putting them in a <details> as I mention here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW I currently think this paragraph should probably be cut. I have no clue what it even is trying to say, but my best guess is that you are getting hung up on a misunderstanding.

But maybe that will become more clear if you add more detail.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment thread library/core/src/cmp.rs
/// - **Irreflexivity**: for all `a` of type `A`, `!(a < a)` and `!(a > a)`.
/// - **Transitivity**: for all `a`, `b`, `c` of type `A`,
/// **`a < b` and `b < c` implies `a < c`**. This must also work for longer chains and
/// all operators, namely `<=`, `==`, `>=`, and `>`.

@RalfJung RalfJung Nov 21, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For == this is redundant as it is already required by PartialEq.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, I included it for completeness, but I'm fine putting more text to clarify that if you think it's helpful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the best clarification is to remove it from the list. This is supposed to list the new axioms one has to prove when instantiating PartialOrd, not summarize all axioms.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This kind of combines with our comment about how this is kind of balancing between just making these docs overbearing and making sure all the details are fully spelled out. Like, in this case, it is an axiom required by PartialOrd to be correct, it's just that PartialEq is specifically providing that requirement already, and so, you will have satisfied it by this point if you've done everything correctly.

But I think it might similarly be confusing if I omitted == from this list for that reason, and also overbearing if I spent the time to add a full sentence clarifying that PartialEq covers this. But, I also think this is more of an aesthetic choice and I'm fine deferring to what people think is best.

@clarfonthey

Copy link
Copy Markdown
Contributor Author

Rebased but going to try and get to the feedback this weekend. I think that I might, assuming that rustdoc doesn't complain, add a few collapsible <details> to the docs that just include more thorough proofs/explanations because the docs are already overwhelming and long, but people do seem to think that having the details fully spelled out would be helpful in some cases.

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Nov 21, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

@clarfonthey clarfonthey added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Nov 21, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor Author

Marking as blocked since I do have some changes I want to do before merge, which are mostly just adding more information. The base guarantees shouldn't change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet