diff --git a/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs b/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs index e44cfd13af..54c5c2080a 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs @@ -1261,7 +1261,8 @@ impl MutTxId { } // Pacify the borrow checker. - // SAFETY: `ptr` came from `tx_table.insert` just now without any interleaving calls. + // SAFETY: `tx_row_ptr` came from `tx_table.insert` just now + // without any interleaving `&mut` calls that could invalidate the pointer. let tx_row_ref = unsafe { tx_table.get_row_ref_unchecked(tx_blob_store, tx_row_ptr) }; // (2) The `tx_row_ref` did not violate a unique constraint *within* the `tx_table`, diff --git a/crates/table/src/btree_index.rs b/crates/table/src/btree_index.rs index 2bc00574c8..96e62bf42b 100644 --- a/crates/table/src/btree_index.rs +++ b/crates/table/src/btree_index.rs @@ -202,7 +202,9 @@ impl TypedIndex { /// or may insert a nonsense value into the index. /// Note, however, that it will not invoke undefined behavior. /// - /// Assumes that this is a unique constraint and returns `Ok(Some(existing_row))` if it's violated. + /// Assumes that this is a unique constraint + /// and returns `Ok(Some(existing_row))` if it's violated. + /// The index is not inserted to in that case. fn insert_unique(&mut self, cols: &ColList, row_ref: RowRef<'_>) -> Result, InvalidFieldError> { fn insert_at_type( this: &mut Index,