@@ -97,7 +97,7 @@ pub struct ArcMonitorGuard<'a, T> {
9797 arc_monitor : & ' a ArcMonitor < T > ,
9898}
9999
100- impl < ' a , T > Drop for ArcMonitorGuard < ' a , T > {
100+ impl < T > Drop for ArcMonitorGuard < ' _ , T > {
101101 fn drop ( & mut self ) {
102102 self . arc_monitor . leave ( ) ;
103103 }
@@ -162,7 +162,7 @@ impl<T> ArcMonitor<T> {
162162
163163 if old_uses > 0 {
164164 return Some ( ArcMonitorGuard {
165- arc_monitor : & self ,
165+ arc_monitor : self ,
166166 } ) ;
167167 }
168168
@@ -176,7 +176,7 @@ impl<T> ArcMonitor<T> {
176176 }
177177
178178 Some ( ArcMonitorGuard {
179- arc_monitor : & self ,
179+ arc_monitor : self ,
180180 } )
181181 }
182182
@@ -222,13 +222,10 @@ impl<T> ArcMonitor<T> {
222222 }
223223 }
224224
225- let is_recycled =
226- self
227- . status
228- . compare_exchange ( ArcMonitorStatus :: Live , ArcMonitorStatus :: Dropped , Ordering :: Release , Ordering :: Relaxed )
229- . is_ok ( ) ;
230-
231- is_recycled
225+ self
226+ . status
227+ . compare_exchange ( ArcMonitorStatus :: Live , ArcMonitorStatus :: Dropped , Ordering :: Release , Ordering :: Relaxed )
228+ . is_ok ( )
232229 }
233230}
234231
@@ -247,20 +244,12 @@ impl<T> DerefMut for ArcMonitor<T> {
247244 }
248245}
249246
247+ #[ derive( Default ) ]
250248pub ( crate ) struct Location {
251249 pub ( crate ) address : usize ,
252250 pub ( crate ) vtable : usize ,
253251}
254252
255- impl Default for Location {
256- fn default ( ) -> Location {
257- Location {
258- address : 0 ,
259- vtable : 0
260- }
261- }
262- }
263-
264253/// In-flight operation
265254pub struct Op < T : ' static , CqeType = SingleCQE >
266255where
@@ -379,7 +368,7 @@ impl<T: Unpin, CqeType: Unpin> Op<T, CqeType> {
379368 fn initialize ( mut self : Pin < Box < Self > > ) -> Pin < Box < Self > > {
380369 let location = ArcMonitor :: < Location > :: new ( Default :: default ( ) , 2 ) ;
381370
382- let this: * mut Self = unsafe { mem :: transmute ( & * self ) } ;
371+ let this = & * self as * const Op < T , CqeType > as * mut Op < T , CqeType > ;
383372 let notifiable: * mut dyn Notifiable = this as * mut _ ;
384373
385374 //SAFETY: Converting current address and vtable to a tuple
0 commit comments