Misleading description of PartialEq derived implementation for enums in docs #97945
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Current docs on
PartialEq
derive state:I interpret the above statement as "
PartialEq
compares enum discriminants", which is not the case.This is true for enums variants with no data, however for enum variants that are struct-like or tuple struct-like, derived
PartialEq
actually compares the fields (which is expected) and not just discriminants:https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=64530ce03a4506d1e82a1df4d78765ff
The text was updated successfully, but these errors were encountered: