Skip to content
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

PartialEq example is not symmetric #53844

Closed
RalfJung opened this issue Aug 31, 2018 · 3 comments
Closed

PartialEq example is not symmetric #53844

RalfJung opened this issue Aug 31, 2018 · 3 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority

Comments

@RalfJung
Copy link
Member

With #51760 landed, the PartialEq documentation now at the same time states

Formally, the equality must be (for all a, b and c):

  • symmetric: a == b implies b == a; and
  • [...]

And gives an example that is not symmetric: b1 == BookFormat::Paperback typechecks, but BookFormat::Paperback == b1 does not.

Cc @gnzlbg @GuillaumeGomez @steveklabnik

@GuillaumeGomez GuillaumeGomez added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Aug 31, 2018
@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 31, 2018

I can fix this in #53386 .

@steveklabnik steveklabnik added the P-medium Medium priority label Dec 27, 2018
@steveklabnik
Copy link
Member

Triage: that PR was never merged, so this is still open.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Jan 5, 2019
- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
@frewsxcv
Copy link
Member

frewsxcv commented Jan 5, 2019

Opened a PR for this #57357

Centril added a commit to Centril/rust that referenced this issue Jan 17, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
Centril added a commit to Centril/rust that referenced this issue Jan 17, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
Centril added a commit to Centril/rust that referenced this issue Jan 17, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
Centril added a commit to Centril/rust that referenced this issue Jan 18, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
Centril added a commit to Centril/rust that referenced this issue Jan 18, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 18, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
Centril added a commit to Centril/rust that referenced this issue Jan 18, 2019
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
VardhanThigle pushed a commit to jethrogb/rust that referenced this issue Jan 31, 2019
- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

5 participants