Skip to content

Commit

Permalink
Use raw ref macros as in rust-lang#80886
Browse files Browse the repository at this point in the history
  • Loading branch information
ssomers authored and cuviper committed Feb 12, 2021
1 parent 48e5866 commit 5a58cf4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/alloc/src/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 5a58cf4

Please sign in to comment.