diff --git a/crates/ty_python_semantic/src/types/tuple.rs b/crates/ty_python_semantic/src/types/tuple.rs index ba5f4ffd47..230040ea80 100644 --- a/crates/ty_python_semantic/src/types/tuple.rs +++ b/crates/ty_python_semantic/src/types/tuple.rs @@ -452,19 +452,6 @@ impl<'db> FixedLengthTuple> { } } -#[allow(unsafe_code)] -unsafe impl salsa::Update for FixedLengthTuple -where - T: salsa::Update, -{ - unsafe fn maybe_update(old_pointer: *mut Self, new_value: Self) -> bool { - unsafe { - let old_value = &mut *old_pointer; - Box::maybe_update(&raw mut old_value.0, new_value.0) - } - } -} - impl<'db> PyIndex<'db> for &FixedLengthTuple> { type Item = Type<'db>; @@ -847,21 +834,6 @@ impl<'db> VariableLengthTuple> { } } -#[allow(unsafe_code)] -unsafe impl salsa::Update for VariableLengthTuple -where - T: salsa::Update, -{ - unsafe fn maybe_update(old_pointer: *mut Self, new_value: Self) -> bool { - let old_value = unsafe { &mut *old_pointer }; - let mut changed = false; - changed |= unsafe { Box::maybe_update(&raw mut old_value.prefix, new_value.prefix) }; - changed |= unsafe { T::maybe_update(&raw mut old_value.variable, new_value.variable) }; - changed |= unsafe { Box::maybe_update(&raw mut old_value.suffix, new_value.suffix) }; - changed - } -} - impl<'db> PyIndex<'db> for &VariableLengthTuple> { type Item = Type<'db>; @@ -1149,28 +1121,6 @@ impl From> for Tuple { } } -#[allow(unsafe_code)] -unsafe impl salsa::Update for Tuple -where - T: salsa::Update, -{ - unsafe fn maybe_update(old_pointer: *mut Self, new_value: Self) -> bool { - let old_value = unsafe { &mut *old_pointer }; - match (old_value, new_value) { - (Tuple::Fixed(old), Tuple::Fixed(new)) => unsafe { - FixedLengthTuple::maybe_update(old, new) - }, - (Tuple::Variable(old), Tuple::Variable(new)) => unsafe { - VariableLengthTuple::maybe_update(old, new) - }, - (old_value, new_value) => { - *old_value = new_value; - true - } - } - } -} - impl<'db> PyIndex<'db> for &Tuple> { type Item = Type<'db>;