diff options
| author | bors <bors@rust-lang.org> | 2021-04-11 10:04:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-11 10:04:46 +0000 |
| commit | 58f32da346642ff3f50186f6f4a0de46e61008be (patch) | |
| tree | bbafa3e5d9232a3e39fc2465519b95c72ebc701a | |
| parent | ba6275b6a9fc05fd5d93220e9a67fe64d663cb62 (diff) | |
| parent | 9aa11a128d20c4ce20a447689099df320a89e254 (diff) | |
| download | rust-58f32da346642ff3f50186f6f4a0de46e61008be.tar.gz rust-58f32da346642ff3f50186f6f4a0de46e61008be.zip | |
Auto merge of #84063 - LingMan:patch-1, r=nagisa
Add note about reverting a workaround in the future The root cause was fixed upstream in LLVM main. This adds a reminder to revert the workaround once the LLVM rustc depends on is new enough. Since I'm not sure how such optimizations get routed to LLVM releases, I used the conservative assumption that it will only show up with LLVM 13.
| -rw-r--r-- | library/core/src/cmp.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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<Rhs: ?Sized = Self>: PartialEq<Rhs> { #[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)) } |
