diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2024-12-22 23:18:40 +0000 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2024-12-29 17:47:30 +0000 |
| commit | cbdac2f0e9da7c1b379bed6da49bde43feb3eed1 (patch) | |
| tree | 5986fdd1ea1b06c9adf4dfa3b6d0a6fcb38e8b16 /compiler/rustc_index | |
| parent | 1bea7f9a446cf6a274e6b5f528ae20dd0b911b82 (diff) | |
| download | rust-cbdac2f0e9da7c1b379bed6da49bde43feb3eed1.tar.gz rust-cbdac2f0e9da7c1b379bed6da49bde43feb3eed1.zip | |
improve `bit_set` assertion
it missed the index and bounds info
Diffstat (limited to 'compiler/rustc_index')
| -rw-r--r-- | compiler/rustc_index/src/bit_set.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index 664b77fd49e..38e2dbbde7d 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -179,7 +179,12 @@ impl<T: Idx> BitSet<T> { /// Insert `elem`. Returns whether the set has changed. #[inline] pub fn insert(&mut self, elem: T) -> bool { - assert!(elem.index() < self.domain_size); + assert!( + elem.index() < self.domain_size, + "inserting element at index {} but domain size is {}", + elem.index(), + self.domain_size, + ); let (word_index, mask) = word_index_and_mask(elem); let word_ref = &mut self.words[word_index]; let word = *word_ref; |
