diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/rc.rs | 18 |
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)] |
