File tree 4 files changed +6
-5
lines changed
4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 234
234
#![ feature( allocator_internals) ]
235
235
#![ feature( allow_internal_unsafe) ]
236
236
#![ feature( allow_internal_unstable) ]
237
+ #![ feature( atomic_mut_ptr) ]
237
238
#![ feature( arbitrary_self_types) ]
238
239
#![ feature( array_error_internals) ]
239
240
#![ feature( asm) ]
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ mod lock {
67
67
//
68
68
// unsafe {
69
69
// let r = core::arch::wasm32::i32_atomic_wait(
70
- // & LOCKED as *const AtomicI32 as *mut i32 ,
70
+ // LOCKED.as_mut_ptr() ,
71
71
// 1, // expected value
72
72
// -1, // timeout
73
73
// );
@@ -143,7 +143,7 @@ mod lock {
143
143
//
144
144
// unsafe {
145
145
// core::arch::wasm32::atomic_notify(
146
- // & LOCKED as *const AtomicI32 as *mut i32 ,
146
+ // LOCKED.as_mut_ptr() ,
147
147
// 1, // only one thread
148
148
// );
149
149
// }
Original file line number Diff line number Diff line change @@ -89,6 +89,6 @@ impl Condvar {
89
89
#[ inline]
90
90
fn ptr ( & self ) -> * mut i32 {
91
91
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
93
93
}
94
94
}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl Mutex {
56
56
#[ inline]
57
57
fn ptr ( & self ) -> * mut i32 {
58
58
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
60
60
}
61
61
}
62
62
@@ -145,6 +145,6 @@ impl ReentrantMutex {
145
145
146
146
#[ inline]
147
147
fn ptr ( & self ) -> * mut i32 {
148
- & self . owner as * const AtomicU32 as * mut i32
148
+ self . owner . as_mut_ptr ( ) as * mut i32
149
149
}
150
150
}
You can’t perform that action at this time.
0 commit comments