#[unstable(feature = "pin", issue = "49150")]
#[inline(always)]
pub fn as_ref(self: &Pin<P>) -> Pin<&P::Target> {
- unsafe { Pin::new_unchecked(&**self) }
+ unsafe { Pin::new_unchecked(&*self.pointer) }
}
}
}
}
-impl<'a, T> Pin<&'a mut T> {
+impl<'a, T: ?Sized> Pin<&'a mut T> {
/// Convert this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
#[unstable(feature = "pin", issue = "49150")]
#[inline(always)]
impl<P: Deref> Deref for Pin<P> {
type Target = P::Target;
fn deref(&self) -> &P::Target {
- &*self.pointer
+ Pin::get_ref(Pin::as_ref(self))
}
}
P::Target: Unpin
{
fn deref_mut(&mut self) -> &mut P::Target {
- &mut *self.pointer
+ Pin::get_mut(Pin::as_mut(self))
}
}