Skip to main content

std_detect/detect/
bit.rs

1//! Bit manipulation utilities.
2
3/// Tests the `bit` of `x`.
4#[allow(dead_code)]
5#[inline]
6pub(crate) fn test(x: usize, bit: u32) -> bool {
7    if true {
    if !(bit < usize::BITS) {
        {
            ::core::panicking::panic_fmt(format_args!("bit index out-of-bounds"));
        }
    };
};debug_assert!(bit < usize::BITS, "bit index out-of-bounds");
8    x & (1 << bit) != 0
9}