+pub(crate) fn unset_features_mask_at_position<T: sealed::Context>(other: &Features<T>, index: usize) -> u8 {
+ const REQUIRED_FEATURES: u8 = 0b01_01_01_01;
+ const OPTIONAL_FEATURES: u8 = 0b10_10_10_10;
+ if index < other.flags.len() {
+ // Form a mask similar to !T::KNOWN_FEATURE_MASK only for `other`
+ !(other.flags[index]
+ | ((other.flags[index] >> 1) & REQUIRED_FEATURES)
+ | ((other.flags[index] << 1) & OPTIONAL_FEATURES))
+ } else {
+ 0b11_11_11_11
+ }
+}
+