rust/tests
bors 816f958ac3 Auto merge of #108157 - scottmcm:tuple-gt-via-partialcmp, r=dtolnay
Use `partial_cmp` to implement tuple `lt`/`le`/`ge`/`gt`

In today's implementation, `(A, B)::gt` contains calls to *both* `A::eq` *and* `A::gt`.

That's fine for primitives, but for things like `String`s it's kinda weird -- `(String, usize)::gt` has a call to both `bcmp` and `memcmp` (<https://rust.godbolt.org/z/7jbbPMesf>) because when `bcmp` says the `String`s aren't equal, it turns around and calls `memcmp` to find out which one's bigger.

This PR changes the implementation to instead implement `(A, …, C, Z)::gt` using `A::partial_cmp`, `…::partial_cmp`, `C::partial_cmp`, and `Z::gt`.  (And analogously for `lt`, `le`, and `ge`.)  That way expensive comparisons don't need to be repeated.

Technically this is an observable change on stable, so I've marked it `needs-fcp` + `T-libs-api` and will
r? rust-lang/libs-api

I'm hoping that this will be non-controversial, however, since it's very similar to the observable changes that were made to the derives (#81384 #98655) -- like those, this only changes behaviour if a type overrode behaviour in a way inconsistent with the rules for the various traits involved.

(The first commit here is #108156, adding the codegen test, which I used to make sure this doesn't regress behaviour for primitives.)

Zulip conversation about this change: <https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/.60.3E.60.20on.20Tuples/near/328392927>.
2023-03-05 22:02:26 +00:00
..
assembly Update the minimum external LLVM to 14 2023-02-10 16:06:25 -08:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
codegen Auto merge of #108157 - scottmcm:tuple-gt-via-partialcmp, r=dtolnay 2023-03-05 22:02:26 +00:00
codegen-units Move /src/test to /tests 2023-01-11 09:32:08 +00:00
debuginfo Remove the capture_disjoint_fields feature 2023-02-28 01:21:15 +00:00
incremental Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir-opt Add needs-unwind 2023-03-03 16:33:12 +01:00
pretty Update tests. 2023-01-29 20:19:26 +01:00
run-make Rollup merge of #108626 - ozkanonur:consistent-json-docs, r=aDotInTheVoid 2023-03-05 14:29:09 +01:00
run-make-fulldeps various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
run-pass-valgrind Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc rustdoc: Note in a type's layout/size if it is uninhabited 2023-03-04 12:07:29 +00:00
rustdoc-gui Add GUI test for rustdoc search errors background 2023-03-02 12:59:04 +01:00
rustdoc-js rustdoc: function signature search with traits in where clause 2023-03-04 09:05:57 -07:00
rustdoc-js-std Rollup merge of #108723 - notriddle:notriddle/where-clause, r=GuillaumeGomez 2023-03-04 20:48:18 +01:00
rustdoc-json Add regression test for #107677 2023-02-18 18:28:17 +01:00
rustdoc-ui Add unstable option new_rpitit to be used for new RPITIT lowering system 2023-03-01 12:56:39 -03:00
ui Rollup merge of #108744 - compiler-errors:non_lifetime_binders-bad-copy-clone, r=jackh726 2023-03-05 14:29:10 +01:00
ui-fulldeps Auto merge of #108233 - ChrisDenton:move-std-tests, r=thomcc 2023-02-25 10:26:57 +00:00
ui-toml/array_size_threshold Fix array-size-threshold config deserialization error 2023-03-02 21:42:11 +01:00
COMPILER_TESTS.md Move /src/test to /tests 2023-01-11 09:32:08 +00:00