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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user