Function branches::likely

source ·
pub fn likely(b: bool) -> bool
Expand description

Hints to the compiler that the branch condition is likely to be true. Returns the value passed to it.

This intrinsic is primarily used with if statements. Using it in other contexts may not have any effect.

Unlike most intrinsics, this function is safe to call and doesn’t require an unsafe block. Therefore, implementations must not require the user to uphold any safety invariants.