Skip to content

Commit cbdac2f

Browse files
committed
improve bit_set assertion
it missed the index and bounds info
1 parent 1bea7f9 commit cbdac2f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_index/src/bit_set.rs

+6-1
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)