diff --git a/library/std/src/sys/wasm/condvar_atomics.rs b/library/std/src/sys/wasm/condvar_atomics.rs index c2c47910582a0..0c1c076cc9142 100644 --- a/library/std/src/sys/wasm/condvar_atomics.rs +++ b/library/std/src/sys/wasm/condvar_atomics.rs @@ -53,7 +53,7 @@ impl Condvar { #[inline] pub unsafe fn notify_all(&self) { self.cnt.fetch_add(1, SeqCst); - // SAFETY: memory_atomic_notify()is always valid + // SAFETY: ptr() is always valid unsafe { wasm32::memory_atomic_notify(self.ptr(), u32::MAX); // -1 == "wake everyone" } diff --git a/library/std/src/sys/wasm/mutex_atomics.rs b/library/std/src/sys/wasm/mutex_atomics.rs index 11d7f4c389dec..479182ffa44d5 100644 --- a/library/std/src/sys/wasm/mutex_atomics.rs +++ b/library/std/src/sys/wasm/mutex_atomics.rs @@ -50,7 +50,7 @@ impl Mutex { #[inline] pub unsafe fn try_lock(&self) -> bool { - unsafe { self.locked.compare_exchange(0, 1, SeqCst, SeqCst).is_ok() } + self.locked.compare_exchange(0, 1, SeqCst, SeqCst).is_ok() } #[inline] @@ -86,7 +86,7 @@ unsafe impl Sync for ReentrantMutex {} impl ReentrantMutex { pub const unsafe fn uninitialized() -> ReentrantMutex { - unsafe { ReentrantMutex { owner: AtomicU32::new(0), recursions: UnsafeCell::new(0) } } + ReentrantMutex { owner: AtomicU32::new(0), recursions: UnsafeCell::new(0) } } pub unsafe fn init(&self) {