Skip to content

Commit 0a0968b

Browse files
committed
Allow modulo_one on function using cfg consts
1 parent 968be98 commit 0a0968b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_data_structures/src/sharded.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ pub fn make_hash<K: Hash + ?Sized>(val: &K) -> u64 {
140140
/// `hash` can be computed with any hasher, so long as that hasher is used
141141
/// consistently for each `Sharded` instance.
142142
#[inline]
143+
#[allow(clippy::modulo_one)]
143144
pub fn get_shard_index_by_hash(hash: u64) -> usize {
144145
let hash_len = mem::size_of::<usize>();
145146
// Ignore the top 7 bits as hashbrown uses these and get the next SHARD_BITS highest bits.

0 commit comments

Comments
 (0)