Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 204df9f

Browse files
committed
improve bit_set assertion
it missed the index and bounds info
1 parent ab7a26a commit 204df9f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_index/src/bit_set.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ impl<T: Idx> BitSet<T> {
179179
/// Insert `elem`. Returns whether the set has changed.
180180
#[inline]
181181
pub fn insert(&mut self, elem: T) -> bool {
182-
assert!(elem.index() < self.domain_size);
182+
assert!(
183+
elem.index() < self.domain_size,
184+
"inserting element at index {} but domain size is {}",
185+
elem.index(),
186+
self.domain_size,
187+
);
183188
let (word_index, mask) = word_index_and_mask(elem);
184189
let word_ref = &mut self.words[word_index];
185190
let word = *word_ref;

0 commit comments

Comments
 (0)