Skip to content

Commit 5a58cf4

Browse files
ssomerscuviper
authored andcommitted
Use raw ref macros as in #80886
1 parent 48e5866 commit 5a58cf4

File tree

1 file changed

+3
-3
lines changed
  • library/alloc/src/collections/btree

1 file changed

+3
-3
lines changed

library/alloc/src/collections/btree/node.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ impl<K, V> LeafNode<K, V> {
7373
// be both slightly faster and easier to track in Valgrind.
7474
unsafe {
7575
// parent_idx, keys, and vals are all MaybeUninit
76-
(&raw mut (*this).parent).write(None);
77-
(&raw mut (*this).len).write(0);
76+
ptr::addr_of_mut!((*this).parent).write(None);
77+
ptr::addr_of_mut!((*this).len).write(0);
7878
}
7979
}
8080

@@ -117,7 +117,7 @@ impl<K, V> InternalNode<K, V> {
117117
unsafe {
118118
let mut node = Box::<Self>::new_uninit();
119119
// We only need to initialize the data; the edges are MaybeUninit.
120-
LeafNode::init(&raw mut (*node.as_mut_ptr()).data);
120+
LeafNode::init(ptr::addr_of_mut!((*node.as_mut_ptr()).data));
121121
node.assume_init()
122122
}
123123
}

0 commit comments

Comments
 (0)