diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index f752472c3ba..0c459a820c6 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -1236,7 +1236,7 @@ fn partial_cmp(&self, _: &()) -> Option { impl PartialOrd for bool { #[inline] fn partial_cmp(&self, other: &bool) -> Option { - (*self as u8).partial_cmp(&(*other as u8)) + Some(self.cmp(other)) } }