From 8787c0b8639cdbebdd160a2ec7100c74456e07bf Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 16 Oct 2025 11:45:07 +1100 Subject: [PATCH] Use `bit_set::Word` in a couple more places. It's a synonym for `u64` and there are a couple of places where we use `u64` where we should use `Word`, which this commit fixes. I found this when I tried changing `Word` to `u128` (which made performance worse). --- compiler/rustc_index/src/bit_set.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index 0e7394006dd2d..6fa3670f8e661 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -873,7 +873,7 @@ impl BitRelations> for ChunkedBitSet { let mut self_chunk_words = **other_chunk_words; for word in self_chunk_words[0..num_words].iter_mut().rev() { *word = !*word & tail_mask; - tail_mask = u64::MAX; + tail_mask = Word::MAX; } let self_chunk_count = chunk_domain_size - *other_chunk_count; debug_assert_eq!( @@ -888,7 +888,7 @@ impl BitRelations> for ChunkedBitSet { ) => { // See `ChunkedBitSet::union` for details on what is happening here. let num_words = num_words(chunk_domain_size as usize); - let op = |a: u64, b: u64| a & !b; + let op = |a: Word, b: Word| a & !b; if !bitwise_changes( &self_chunk_words[0..num_words], &other_chunk_words[0..num_words],