We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2dd217 commit b2dbbb6Copy full SHA for b2dbbb6
compiler/rustc_index/src/bit_set.rs
@@ -194,7 +194,11 @@ impl<T: Idx> DenseBitSet<T> {
194
self.domain_size,
195
);
196
let (word_index, mask) = word_index_and_mask(elem);
197
- let word_ref = &mut self.words[word_index];
+ // SAFETY:
198
+ // The number of words we have is the domain size divided by word size (rounded up). We have
199
+ // asserted above that the element is contained within the domain size. Therefore,
200
+ // word_index is in bounds.
201
+ let word_ref = unsafe { self.words.get_unchecked_mut(word_index) };
202
let word = *word_ref;
203
let new_word = word | mask;
204
*word_ref = new_word;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments