about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStein Somers <git@steinsomers.be>2021-02-04 16:11:30 +0100
committerJosh Stone <jistone@redhat.com>2021-02-12 12:14:17 -0800
commit5a58cf4943da9ea50c0cc534756bee31b4ac1899 (patch)
tree9d6f33d5204fd59af4fddc12fc488c844d8bb2d1
parent48e5866d11c6bdff9e1d55ad53c758e2fcdddcb1 (diff)
downloadrust-5a58cf4943da9ea50c0cc534756bee31b4ac1899.tar.gz
rust-5a58cf4943da9ea50c0cc534756bee31b4ac1899.zip
Use raw ref macros as in #80886
-rw-r--r--library/alloc/src/collections/btree/node.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs
index c326a9bc775..50d6fb11b11 100644
--- a/library/alloc/src/collections/btree/node.rs
+++ b/library/alloc/src/collections/btree/node.rs
@@ -73,8 +73,8 @@ impl<K, V> LeafNode<K, V> {
         // be both slightly faster and easier to track in Valgrind.
         unsafe {
             // parent_idx, keys, and vals are all MaybeUninit
-            (&raw mut (*this).parent).write(None);
-            (&raw mut (*this).len).write(0);
+            ptr::addr_of_mut!((*this).parent).write(None);
+            ptr::addr_of_mut!((*this).len).write(0);
         }
     }
 
@@ -117,7 +117,7 @@ impl<K, V> InternalNode<K, V> {
         unsafe {
             let mut node = Box::<Self>::new_uninit();
             // We only need to initialize the data; the edges are MaybeUninit.
-            LeafNode::init(&raw mut (*node.as_mut_ptr()).data);
+            LeafNode::init(ptr::addr_of_mut!((*node.as_mut_ptr()).data));
             node.assume_init()
         }
     }