Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteNacked committed Oct 15, 2024
1 parent 03d93b3 commit 6361454
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions sandbox/host/src/store_refcell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ impl<S> StoreRefCell<S> {
store: impl GenericAsStoreMut,
f: F,
) -> Result<R, BorrowScopeError> {
// We expect the same store
//debug_assert!(
// self.compare_stores(store.as_store_ref()),
// "stores are different"
//);

// Caller just returned borrowed mutably reference to the store, now we can safely borrow it mutably again
let _store = store;

Expand All @@ -201,16 +195,6 @@ impl<S> StoreRefCell<S> {
Ok(result)
}

//#[allow(unused)]
//fn compare_stores(&self, returned_store: StoreRef) -> bool {
// // SAFETY:
// // Verified with Miri, it seems safe.
// // Carefully compare the stores while don't using/holding mutable references to them in the same time.
// let orig_store_ref: StoreRef = unsafe { &*self.store.get() }.as_store_ref();

// StoreRef::same(&orig_store_ref, &returned_store)
//}

/// Returns store ptr, same semantics as `RefCell::as_ptr`
pub unsafe fn as_ptr(&self) -> *mut S {
self.store.get()
Expand Down

0 comments on commit 6361454

Please sign in to comment.