compiler/rust/bitset: Remove impl Not

This is extremely difficult to use correctly for bitsets of
different sizes. Also, nobody uses it. Remove the footgun.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32812>
This commit is contained in:
Mel Henning
2024-12-23 21:01:58 -05:00
committed by Marge Bot
parent 8ec885da1d
commit e52b2ee4b9
+1 -13
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
use std::ops::{
BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not, Range,
BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Range,
};
#[derive(Clone)]
@@ -221,18 +221,6 @@ impl BitXor<BitSet> for BitSet {
}
}
impl Not for BitSet {
type Output = BitSet;
fn not(self) -> BitSet {
let mut res = self;
for w in 0..res.words.len() {
res.words[w] = !res.words[w];
}
res
}
}
struct BitSetIter<'a> {
set: &'a BitSet,
w: usize,