Merge 'Remove some unnecessary unsafe impls' from Pedro Muniz

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3236
This commit is contained in:
Pekka Enberg
2025-09-22 07:33:50 +03:00
committed by GitHub
4 changed files with 1 additions and 13 deletions

View File

@@ -34,7 +34,6 @@ impl<T> DerefMut for SpinLockGuard<'_, T> {
}
}
unsafe impl<T: Send> Send for SpinLock<T> {}
unsafe impl<T> Sync for SpinLock<T> {}
impl<T> SpinLock<T> {

View File

@@ -12,7 +12,6 @@ use tracing::debug;
pub struct MemoryIO {
files: Arc<Mutex<HashMap<String, Arc<MemoryFile>>>>,
}
unsafe impl Send for MemoryIO {}
// TODO: page size flag
const PAGE_SIZE: usize = 4096;
@@ -76,7 +75,7 @@ pub struct MemoryFile {
pages: UnsafeCell<BTreeMap<usize, MemPage>>,
size: Cell<u64>,
}
unsafe impl Send for MemoryFile {}
unsafe impl Sync for MemoryFile {}
impl File for MemoryFile {

View File

@@ -17,9 +17,6 @@ use tracing::{instrument, trace, Level};
pub struct UnixIO {}
unsafe impl Send for UnixIO {}
unsafe impl Sync for UnixIO {}
impl UnixIO {
#[cfg(feature = "fs")]
pub fn new() -> Result<Self> {
@@ -128,8 +125,6 @@ impl IO for UnixIO {
pub struct UnixFile {
file: Arc<Mutex<std::fs::File>>,
}
unsafe impl Send for UnixFile {}
unsafe impl Sync for UnixFile {}
impl File for UnixFile {
fn lock_file(&self, exclusive: bool) -> Result<()> {

View File

@@ -88,11 +88,6 @@ pub struct DatabaseFile {
file: Arc<dyn crate::io::File>,
}
#[cfg(feature = "fs")]
unsafe impl Send for DatabaseFile {}
#[cfg(feature = "fs")]
unsafe impl Sync for DatabaseFile {}
#[cfg(feature = "fs")]
impl DatabaseStorage for DatabaseFile {
#[instrument(skip_all, level = Level::DEBUG)]