Remove Addr::as_ref and AddrMut::as_ref

Summary: These operations are misleading and should never be called. Since the address could be a remote address, dereferencing it like this is wildly wrong. Not quite sure how they got there in the first place.

Reviewed By: igorsugak

Differential Revision: D41193389

fbshipit-source-id: 143c491df81125b319f7d5d88049021a81981795
This commit is contained in:
Jason White 2022-11-10 15:26:59 -08:00 committed by Facebook GitHub Bot
parent 84da445a0d
commit df05ba9e83

View file

@ -135,12 +135,6 @@ impl<'a, T> From<&'a T> for Addr<'a, T> {
}
}
impl<'a, T> AsRef<T> for Addr<'a, T> {
fn as_ref(&self) -> &T {
unsafe { self.inner.as_ref() }
}
}
impl<'a, T> fmt::Debug for Addr<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Pointer::fmt(&self.inner, f)
@ -272,12 +266,6 @@ impl<'a, T> From<&'a T> for AddrMut<'a, T> {
}
}
impl<'a, T> AsRef<T> for AddrMut<'a, T> {
fn as_ref(&self) -> &T {
unsafe { self.inner.as_ref() }
}
}
impl<'a, T> fmt::Debug for AddrMut<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Pointer::fmt(&self.inner, f)