diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 1dbf47206e4..67dd1d83415 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -982,6 +982,9 @@ pub trait PartialOrd: PartialEq { #[stable(feature = "rust1", since = "1.0.0")] fn le(&self, other: &Rhs) -> bool { // Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`. + // FIXME: The root cause was fixed upstream in LLVM with: + // https://github.com/llvm/llvm-project/commit/9bad7de9a3fb844f1ca2965f35d0c2a3d1e11775 + // Revert this workaround once support for LLVM 12 gets dropped. !matches!(self.partial_cmp(other), None | Some(Greater)) }