rust/library/core
bors 8841bee954 Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm
Manually implement PartialEq for Option<T> and specialize non-nullable types

This PR manually implements `PartialEq` and `StructuralPartialEq` for `Option`, which seems to produce slightly better codegen than the automatically derived implementation.

It also allows specializing on the `core::num::NonZero*` and `core::ptr::NonNull` types, taking advantage of the niche optimization by transmuting the `Option<T>` to `T` to be compared directly, which can be done in just two instructions.

A comparison of the original, new and specialized code generation is available [here](https://godbolt.org/z/dE4jxdYsa).
2022-11-26 08:56:20 +00:00
..
benches Rollup merge of #103570 - lukas-code:stabilize-ilog, r=scottmcm 2022-11-09 19:21:21 +05:30
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm 2022-11-26 08:56:20 +00:00
tests Rollup merge of #83608 - Kimundi:index_many, r=Mark-Simulacrum 2022-11-22 01:26:05 -05:00
Cargo.toml Avoid use of rand::thread_rng in stdlib benchmarks 2022-05-02 00:08:21 -07:00