File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 234234#![ feature( allocator_internals) ]
235235#![ feature( allow_internal_unsafe) ]
236236#![ feature( allow_internal_unstable) ]
237+ #![ feature( atomic_mut_ptr) ]
237238#![ feature( arbitrary_self_types) ]
238239#![ feature( array_error_internals) ]
239240#![ feature( asm) ]
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ mod lock {
6767 //
6868 // unsafe {
6969 // let r = core::arch::wasm32::i32_atomic_wait(
70- // & LOCKED as *const AtomicI32 as *mut i32 ,
70+ // LOCKED.as_mut_ptr() ,
7171 // 1, // expected value
7272 // -1, // timeout
7373 // );
@@ -143,7 +143,7 @@ mod lock {
143143 //
144144 // unsafe {
145145 // core::arch::wasm32::atomic_notify(
146- // & LOCKED as *const AtomicI32 as *mut i32 ,
146+ // LOCKED.as_mut_ptr() ,
147147 // 1, // only one thread
148148 // );
149149 // }
Original file line number Diff line number Diff line change @@ -89,6 +89,6 @@ impl Condvar {
8989 #[ inline]
9090 fn ptr ( & self ) -> * mut i32 {
9191 assert_eq ! ( mem:: size_of:: <usize >( ) , mem:: size_of:: <i32 >( ) ) ;
92- & self . cnt as * const AtomicUsize as * mut i32
92+ self . cnt . as_mut_ptr ( ) as * mut i32
9393 }
9494}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl Mutex {
5656 #[ inline]
5757 fn ptr ( & self ) -> * mut i32 {
5858 assert_eq ! ( mem:: size_of:: <usize >( ) , mem:: size_of:: <i32 >( ) ) ;
59- & self . locked as * const AtomicUsize as * mut isize as * mut i32
59+ self . locked . as_mut_ptr ( ) as * mut i32
6060 }
6161}
6262
@@ -145,6 +145,6 @@ impl ReentrantMutex {
145145
146146 #[ inline]
147147 fn ptr ( & self ) -> * mut i32 {
148- & self . owner as * const AtomicU32 as * mut i32
148+ self . owner . as_mut_ptr ( ) as * mut i32
149149 }
150150}
You can’t perform that action at this time.
0 commit comments