From e6f85c2f78bc0488c7cf08121b26dcbc85a846ba Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 21 Jan 2015 13:55:11 -0800 Subject: Revert "Add assumptions that the pointer is non-null" This reverts commit 9bbfd681c9fa47f462a89e8f5eedd3fa2a5de2e7. --- src/liballoc/rc.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/liballoc') 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 { impl RcBoxPtr for Rc { #[inline(always)] - fn inner(&self) -> &RcBox { - 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 { unsafe { &(**self._ptr) } } } impl RcBoxPtr for Weak { #[inline(always)] - fn inner(&self) -> &RcBox { - 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 { unsafe { &(**self._ptr) } } } #[cfg(test)] -- cgit 1.4.1-3-g733a5