提交 18f47d81 编写于 作者: A Ayush Kumar Mishra

Misleading documentation for derived Ord/PartialOrd implementation for enums #75620

上级 e482c86b
......@@ -505,7 +505,7 @@ fn cmp(&self, other: &Reverse<T>) -> Ordering {
///
/// This trait can be used with `#[derive]`. When `derive`d on structs, it will produce a
/// lexicographic 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 declaration order.
/// When `derive`d on enums, variants are ordered by their top-to-bottom discriminant order.
///
/// ## How can I implement `Ord`?
///
......@@ -694,7 +694,7 @@ fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
///
/// This trait can be used with `#[derive]`. When `derive`d on structs, it will produce a
/// lexicographic 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 declaration order.
/// When `derive`d on enums, variants are ordered by their top-to-bottom discriminant order.
///
/// ## How can I implement `PartialOrd`?
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册