mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
add const hack comment
This commit is contained in:
@@ -802,6 +802,9 @@ fn max(self, other: Self) -> Self
|
||||
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 @@ fn min(self, other: Self) -> Self
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user