From 7bbf914078fe3124bc077ce4a52b793c93086c4d Mon Sep 17 00:00:00 2001 From: Alan Egerton Date: Fri, 10 Jun 2022 16:26:00 +0100 Subject: [PATCH] Clarify `#[derive(PartialEq)]` on enums Fixes #97945 --- library/core/src/cmp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index f281e8429c693..7884e302d983b 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -61,8 +61,8 @@ use self::Ordering::*; /// /// This trait can be used with `#[derive]`. When `derive`d on structs, two /// instances are equal if all fields are equal, and not equal if any fields -/// are not equal. When `derive`d on enums, each variant is equal to itself -/// and not equal to the other variants. +/// are not equal. When `derive`d on enums, two instances are equal if they +/// are the same variant and all fields are equal. /// /// ## How can I implement `PartialEq`? ///