diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 79610bb409d37..4e82b65539460 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -660,6 +660,18 @@ impl Clone for Reverse { /// This trait can be used with `#[derive]`. When `derive`d on structs, it will produce a /// [lexicographic](https://en.wikipedia.org/wiki/Lexicographic_order) ordering based on the top-to-bottom declaration order of the struct's members. /// When `derive`d on enums, variants are ordered by their top-to-bottom discriminant order. +/// This means variants at the top are less than variants at the bottom. +/// Here's an example: +/// +/// ``` +/// #[derive(PartialEq, PartialOrd)] +/// enum Size { +/// Small, +/// Large, +/// } +/// +/// assert!(Size::Small < Size::Large); +/// ``` /// /// ## Lexicographical comparison ///