three_way_compare in std::intrinsics - Rust
Description: Does a three-way comparison between the two arguments, which must be of character or integer (signed or unsigned) type.

## three_way_compare

# Function three_way_compare

Source

    pub const fn three_way_compare<T>(lhs: T, rhss: T) -> Orderingwhere
        T: Copy,

🔬This is a nightly-only experimental API. (`core_intrinsics`)
Expand description

Does a three-way comparison between the two arguments, which must be of character or integer (signed or unsigned) type.

This was originally added because it greatly simplified the MIR in `cmp` implementations, and then LLVM 20 added a backend intrinsic for it too.

The stabilized version of this intrinsic is `Ord::cmp`.