Skip to content

Commit 95ce748

Browse files
authored
Unrolled build for #146690
Rollup merge of #146690 - npmccallum:convo, r=tgross35 add `[const] PartialEq` bound to `PartialOrd` This change is included for discussion purposes. The PartialOrd bound on PartialEq is not strictly necessary. It is, rather, logical: anything which is orderable should by definition have equality. Is the same true for constness? Should every type which is const orderable also have const equality?
2 parents 0be8e16 + 8d7ec96 commit 95ce748

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/core/src/cmp.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,9 @@ pub macro Ord($item:item) {
13511351
#[rustc_diagnostic_item = "PartialOrd"]
13521352
#[allow(multiple_supertrait_upcastable)] // FIXME(sized_hierarchy): remove this
13531353
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
1354-
pub const trait PartialOrd<Rhs: PointeeSized = Self>: PartialEq<Rhs> + PointeeSized {
1354+
pub const trait PartialOrd<Rhs: PointeeSized = Self>:
1355+
[const] PartialEq<Rhs> + PointeeSized
1356+
{
13551357
/// This method returns an ordering between `self` and `other` values if one exists.
13561358
///
13571359
/// # Examples

0 commit comments

Comments
 (0)