Function core::const: unstable · source ·
pub unsafe extern "rust-intrinsic" fn raw_eq<T>(a: &T, b: &T) -> bool
Determines whether the raw bytes of the two values are equal.
This is particularly handy for arrays, since it allows things like just
i96s instead of forcing
[6 x i16].
Above some backend-decided threshold this will emit calls to
like slice equality does, instead of causing massive code size.
Since this works by comparing the underlying bytes, the actual
not particularly important. It will be used for its size and alignment,
but any validity restrictions will be ignored, not enforced.
It’s UB to call this if any of the bytes in
*b are uninitialized or carry a
Note that this is a stricter criterion than just the values being
T has padding, it’s UB to call this intrinsic.
(The implementation is allowed to branch on the results of comparisons,
which is UB if any of their inputs are