Skip to content

Better docs for PartialEq#156144

Open
hkBst wants to merge 1 commit intorust-lang:mainfrom
hkBst:improve-partial-eq-docs
Open

Better docs for PartialEq#156144
hkBst wants to merge 1 commit intorust-lang:mainfrom
hkBst:improve-partial-eq-docs

Conversation

@hkBst
Copy link
Copy Markdown
Member

@hkBst hkBst commented May 4, 2026

No description provided.

@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 May 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

r? @nia-e

rustbot has assigned @nia-e.
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: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt, nia-e, scottmcm

Comment thread library/core/src/cmp.rs
fn eq(&self, other: &Rhs) -> bool;

/// Tests for `!=`. The default implementation is almost always sufficient,
/// and should not be overridden without very good reason.
Copy link
Copy Markdown
Member

@nia-e nia-e May 4, 2026

Choose a reason for hiding this comment

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

This warning should probably remain in some form

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've now tried to reword to mention the few cases where it could make sense to override (line 269).

Comment thread library/core/src/cmp.rs Outdated
/// Implements `PartialEq` for primitive types.
///
/// Primitive types have a compiler-defined primitive implementation of `==` and `!=`.
/// This implements the `PartialEq` trait is terms of those primitive implementations.
Copy link
Copy Markdown
Member

@nia-e nia-e May 4, 2026

Choose a reason for hiding this comment

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

typo: "trait [in] terms of"

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 4, 2026
@nia-e
Copy link
Copy Markdown
Member

nia-e commented May 4, 2026

Looks mostly fine, just a few comments. Thanks!

@rust-cloud-vms rust-cloud-vms Bot force-pushed the improve-partial-eq-docs branch from a52171b to d3db8b5 Compare May 4, 2026 16:32
@rust-cloud-vms rust-cloud-vms Bot force-pushed the improve-partial-eq-docs branch from d3db8b5 to f25a255 Compare May 5, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. 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.

3 participants