Function three_way_compare

Source
pub const fn three_way_compare<T>(lhs: T, rhss: T) -> Ordering
where 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.