]> git.proxmox.com Git - rustc.git/blame - src/tools/rustfmt/tests/source/cfg_if/detect/bit.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / rustfmt / tests / source / cfg_if / detect / bit.rs
CommitLineData
f20569fa
XL
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 debug_assert!(bit < 32, "bit index out-of-bounds");
8 x & (1 << bit) != 0
9}