From 606568d98753ed9ed24c6b5256f9055c0345206b Mon Sep 17 00:00:00 2001 From: Sebastiano Vigna Date: Mon, 25 Nov 2024 18:03:18 +0100 Subject: [PATCH] Missing unsafe --- src/utils/sync_slice.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/sync_slice.rs b/src/utils/sync_slice.rs index 3b47b304..2ffc29bc 100644 --- a/src/utils/sync_slice.rs +++ b/src/utils/sync_slice.rs @@ -136,7 +136,7 @@ impl SyncCell { /// same time. It is responsibility of the user to ensure that there are no /// data races, which would cause undefined behavior. #[inline] - pub fn replace(&self, val: T) -> T { + pub unsafe fn replace(&self, val: T) -> T { self.0.replace(val) } @@ -156,7 +156,7 @@ impl SyncCell { /// same time. It is responsibility of the user to ensure that there are no /// data races, which would cause undefined behavior. #[inline] - pub fn get(&self) -> T { + pub unsafe fn get(&self) -> T { self.0.get() } }