Files
rust/library/core/src
Jacob Pratt 1ba9b7873a Rollup merge of #138135 - scottmcm:chaining-ord, r=Mark-Simulacrum
Simplify `PartialOrd` on tuples containing primitives

We noticed in https://github.com/rust-lang/rust/pull/133984#issuecomment-2704011800 that currently the tuple comparison code, while it [does optimize down](https://github.com/rust-lang/rust/blob/master/tests/codegen/comparison-operators-2-tuple.rs) today, is kinda huge: <https://rust.godbolt.org/z/xqMoeYbhE>

This PR changes the tuple code to go through an overridable "chaining" version of the comparison functions, so that for simple things like `(i16, u16)` and `(f32, f32)` (as seen in the new MIR pre-codegen test) we just directly get the
```rust
if lhs.0 == rhs.0 { lhs.0 OP rhs.0 }
else { lhs.1 OP rhs.1 }
```
version in MIR, rather than emitting a mess for LLVM to have to clean up.

Test added in the first commit, so you can see the MIR diff in the second one.
2025-03-23 20:44:09 -04:00
..
2024-10-09 19:34:27 -04:00
2025-02-15 13:34:01 +06:00
2025-03-23 17:47:10 +09:00
2025-03-16 17:47:56 +00:00
2025-03-21 20:51:06 +00:00
2025-03-06 13:21:59 -08:00
2024-07-29 08:26:52 +10:00
2024-07-29 08:26:52 +10:00
2025-03-06 13:21:59 -08:00
2025-02-27 19:06:06 -08:00
2025-03-06 13:21:59 -08:00
2025-03-23 15:27:31 -07:00
2025-02-18 09:32:44 -08:00
2024-06-11 15:47:00 +02:00
2025-01-20 18:35:32 +01:00
2025-02-18 08:50:21 -08:00
2024-07-26 13:26:33 +01:00
2024-11-27 15:14:54 +00:00
2025-02-18 09:32:44 -08:00
2025-03-19 17:37:35 +01:00
2025-02-18 09:32:44 -08:00
2025-03-23 15:27:31 -07:00