@@ -102,7 +102,7 @@ impl<T, ProducerAddition, ConsumerAddition> Queue<T, ProducerAddition, ConsumerA
102102 ) -> Self {
103103 let n1 = Node :: new ( ) ;
104104 let n2 = Node :: new ( ) ;
105- ( * n1) . next . store ( n2, Ordering :: Relaxed ) ;
105+ ( & ( * n1) . next ) . store ( n2, Ordering :: Relaxed ) ;
106106 Queue {
107107 consumer : CacheAligned :: new ( Consumer {
108108 tail : UnsafeCell :: new ( n2) ,
@@ -127,10 +127,10 @@ impl<T, ProducerAddition, ConsumerAddition> Queue<T, ProducerAddition, ConsumerA
127127 // Acquire a node (which either uses a cached one or allocates a new
128128 // one), and then append this to the 'head' node.
129129 let n = self . alloc ( ) ;
130- assert ! ( ( * n) . value. is_none( ) ) ;
130+ assert ! ( ( & ( * n) . value) . is_none( ) ) ;
131131 ( * n) . value = Some ( t) ;
132- ( * n) . next . store ( ptr:: null_mut ( ) , Ordering :: Relaxed ) ;
133- ( * * self . producer . head . get ( ) ) . next . store ( n, Ordering :: Release ) ;
132+ ( & ( * n) . next ) . store ( ptr:: null_mut ( ) , Ordering :: Relaxed ) ;
133+ ( & ( * * self . producer . head . get ( ) ) . next ) . store ( n, Ordering :: Release ) ;
134134 * ( & self . producer . head ) . get ( ) = n;
135135 }
136136 }
@@ -139,15 +139,15 @@ impl<T, ProducerAddition, ConsumerAddition> Queue<T, ProducerAddition, ConsumerA
139139 // First try to see if we can consume the 'first' node for our uses.
140140 if * self . producer . first . get ( ) != * self . producer . tail_copy . get ( ) {
141141 let ret = * self . producer . first . get ( ) ;
142- * self . producer . 0 . first . get ( ) = ( * ret) . next . load ( Ordering :: Relaxed ) ;
142+ * self . producer . 0 . first . get ( ) = ( & ( * ret) . next ) . load ( Ordering :: Relaxed ) ;
143143 return ret;
144144 }
145145 // If the above fails, then update our copy of the tail and try
146146 // again.
147147 * self . producer . 0 . tail_copy . get ( ) = self . consumer . tail_prev . load ( Ordering :: Acquire ) ;
148148 if * self . producer . first . get ( ) != * self . producer . tail_copy . get ( ) {
149149 let ret = * self . producer . first . get ( ) ;
150- * self . producer . 0 . first . get ( ) = ( * ret) . next . load ( Ordering :: Relaxed ) ;
150+ * self . producer . 0 . first . get ( ) = ( & ( * ret) . next ) . load ( Ordering :: Relaxed ) ;
151151 return ret;
152152 }
153153 // If all of that fails, then we have to allocate a new node
@@ -164,12 +164,12 @@ impl<T, ProducerAddition, ConsumerAddition> Queue<T, ProducerAddition, ConsumerA
164164 // tail's next field and see if we can use it. If we do a pop, then
165165 // the current tail node is a candidate for going into the cache.
166166 let tail = * self . consumer . tail . get ( ) ;
167- let next = ( * tail) . next . load ( Ordering :: Acquire ) ;
167+ let next = ( & ( * tail) . next ) . load ( Ordering :: Acquire ) ;
168168 if next. is_null ( ) {
169169 return None ;
170170 }
171- assert ! ( ( * next) . value. is_some( ) ) ;
172- let ret = ( * next) . value . take ( ) ;
171+ assert ! ( ( & ( * next) . value) . is_some( ) ) ;
172+ let ret = ( & mut ( * next) . value ) . take ( ) ;
173173
174174 * self . consumer . 0 . tail . get ( ) = next;
175175 if self . consumer . cache_bound == 0 {
@@ -184,8 +184,7 @@ impl<T, ProducerAddition, ConsumerAddition> Queue<T, ProducerAddition, ConsumerA
184184 if ( * tail) . cached {
185185 self . consumer . tail_prev . store ( tail, Ordering :: Release ) ;
186186 } else {
187- ( * self . consumer . tail_prev . load ( Ordering :: Relaxed ) )
188- . next
187+ ( & ( * self . consumer . tail_prev . load ( Ordering :: Relaxed ) ) . next )
189188 . store ( next, Ordering :: Relaxed ) ;
190189 // We have successfully erased all references to 'tail', so
191190 // now we can safely drop it.
@@ -208,8 +207,8 @@ impl<T, ProducerAddition, ConsumerAddition> Queue<T, ProducerAddition, ConsumerA
208207 // stripped out.
209208 unsafe {
210209 let tail = * self . consumer . tail . get ( ) ;
211- let next = ( * tail) . next . load ( Ordering :: Acquire ) ;
212- if next. is_null ( ) { None } else { ( * next) . value . as_mut ( ) }
210+ let next = ( & ( * tail) . next ) . load ( Ordering :: Acquire ) ;
211+ if next. is_null ( ) { None } else { ( & mut ( * next) . value ) . as_mut ( ) }
213212 }
214213 }
215214
@@ -227,7 +226,7 @@ impl<T, ProducerAddition, ConsumerAddition> Drop for Queue<T, ProducerAddition,
227226 unsafe {
228227 let mut cur = * self . producer . first . get ( ) ;
229228 while !cur. is_null ( ) {
230- let next = ( * cur) . next . load ( Ordering :: Relaxed ) ;
229+ let next = ( & ( * cur) . next ) . load ( Ordering :: Relaxed ) ;
231230 let _n: Box < Node < T > > = Box :: from_raw ( cur) ;
232231 cur = next;
233232 }
0 commit comments