about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-21 13:55:11 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-21 13:55:11 -0800
commite6f85c2f78bc0488c7cf08121b26dcbc85a846ba (patch)
tree3ef8b0d7225d2156bfd7208939254c3b191b6ada /src/liballoc
parentee253c918d2fb961dbdf5c6dbe40dd7fee20148e (diff)
downloadrust-e6f85c2f78bc0488c7cf08121b26dcbc85a846ba.tar.gz
rust-e6f85c2f78bc0488c7cf08121b26dcbc85a846ba.zip
Revert "Add assumptions that the pointer is non-null"
This reverts commit 9bbfd681c9fa47f462a89e8f5eedd3fa2a5de2e7.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/rc.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 65f5ed06254..ce160eec103 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -779,26 +779,12 @@ trait RcBoxPtr<T> {
 
 impl<T> RcBoxPtr<T> for Rc<T> {
     #[inline(always)]
-    fn inner(&self) -> &RcBox<T> {
-        unsafe {
-            // Safe to assume this here, as if it weren't true, we'd be breaking
-            // the contract anyway
-            assume(!self._ptr.is_null());
-            &(**self._ptr)
-        }
-    }
+    fn inner(&self) -> &RcBox<T> { unsafe { &(**self._ptr) } }
 }
 
 impl<T> RcBoxPtr<T> for Weak<T> {
     #[inline(always)]
-    fn inner(&self) -> &RcBox<T> {
-        unsafe {
-            // Safe to assume this here, as if it weren't true, we'd be breaking
-            // the contract anyway
-            assume(!self._ptr.is_null());
-            &(**self._ptr)
-        }
-    }
+    fn inner(&self) -> &RcBox<T> { unsafe { &(**self._ptr) } }
 }
 
 #[cfg(test)]