Skip to content

Commit de39a4f

Browse files
committed
Respect the comment: no root unless the borrow type is Mut
1 parent 607315b commit de39a4f

File tree

1 file changed

+2
-2
lines changed
  • src/liballoc/collections/btree

1 file changed

+2
-2
lines changed

src/liballoc/collections/btree/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<K, V> Root<K, V> {
161161
NodeRef {
162162
height: self.height,
163163
node: self.node.as_ptr(),
164-
root: self as *const _ as *mut _,
164+
root: ptr::null(),
165165
_marker: PhantomData,
166166
}
167167
}
@@ -179,7 +179,7 @@ impl<K, V> Root<K, V> {
179179
NodeRef {
180180
height: self.height,
181181
node: self.node.as_ptr(),
182-
root: ptr::null_mut(), // FIXME: Is there anything better to do here?
182+
root: ptr::null(),
183183
_marker: PhantomData,
184184
}
185185
}

0 commit comments

Comments
 (0)