From 65fca6db1949b2aa30a93b382b899a60bfddb132 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Fri, 14 Jan 2022 16:55:19 +0800 Subject: [PATCH] add const hack comment --- library/core/src/cmp.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index e81d15f6c7c..ac286c171f0 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -802,6 +802,9 @@ pub trait Ord: Eq + PartialOrd { Self: Sized, Self: ~const Destruct, { + // HACK(fee1-dead): go back to using `self.max_by(other, Ord::cmp)` + // when trait methods are allowed to be used when a const closure is + // expected. match self.cmp(&other) { Ordering::Less | Ordering::Equal => other, Ordering::Greater => self, @@ -826,6 +829,9 @@ pub trait Ord: Eq + PartialOrd { Self: Sized, Self: ~const Destruct, { + // HACK(fee1-dead): go back to using `self.min_by(other, Ord::cmp)` + // when trait methods are allowed to be used when a const closure is + // expected. match self.cmp(&other) { Ordering::Less | Ordering::Equal => self, Ordering::Greater => other,