about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorStein Somers <git@steinsomers.be>2020-04-09 20:19:18 +0200
committerStein Somers <git@steinsomers.be>2020-04-09 21:37:30 +0200
commitde39a4f6218fac9d0b9d09a928613b4aa2407a31 (patch)
treed23194d9f757990c2e838fec3a073e94fb6eb176 /src/liballoc
parent607315b2c34bb6c373cf3fc8283ab6b05414d114 (diff)
downloadrust-de39a4f6218fac9d0b9d09a928613b4aa2407a31.tar.gz
rust-de39a4f6218fac9d0b9d09a928613b4aa2407a31.zip
Respect the comment: no root unless the borrow type is `Mut`
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/btree/node.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs
index bc4e2711670..84d34db2d45 100644
--- a/src/liballoc/collections/btree/node.rs
+++ b/src/liballoc/collections/btree/node.rs
@@ -161,7 +161,7 @@ impl<K, V> Root<K, V> {
         NodeRef {
             height: self.height,
             node: self.node.as_ptr(),
-            root: self as *const _ as *mut _,
+            root: ptr::null(),
             _marker: PhantomData,
         }
     }
@@ -179,7 +179,7 @@ impl<K, V> Root<K, V> {
         NodeRef {
             height: self.height,
             node: self.node.as_ptr(),
-            root: ptr::null_mut(), // FIXME: Is there anything better to do here?
+            root: ptr::null(),
             _marker: PhantomData,
         }
     }