mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
Revert "Add assumptions that the pointer is non-null"
This reverts commit 9bbfd681c9
.
This commit is contained in:
parent
ee253c918d
commit
e6f85c2f78
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user