From e52b2ee4b9b27916fa012f281888bd2d65518c32 Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Mon, 23 Dec 2024 21:01:58 -0500 Subject: [PATCH] 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 Part-of: --- src/compiler/rust/bitset.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/compiler/rust/bitset.rs b/src/compiler/rust/bitset.rs index 21238200475..e0cff08c61b 100644 --- a/src/compiler/rust/bitset.rs +++ b/src/compiler/rust/bitset.rs @@ -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 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,