X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcore%2Fpin.rs;h=d09a545aecfaf8a6072aedeada9e54f072d540c6;hb=574bca7262f0ddab9e1818253012dbff34755b98;hp=3ab6dcd8531d138356d7abd82cbdc24f6d8c7749;hpb=403d12d696a344cd6a9251e46c313e00f0316f9b;p=rust.git diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index 3ab6dcd8531..d09a545aecf 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -154,7 +154,7 @@ pub unsafe fn new_unchecked(pointer: P) -> Pin

{ #[unstable(feature = "pin", issue = "49150")] #[inline(always)] pub fn as_ref(self: &Pin

) -> Pin<&P::Target> { - unsafe { Pin::new_unchecked(&**self) } + unsafe { Pin::new_unchecked(&*self.pointer) } } } @@ -212,7 +212,7 @@ pub fn get_ref(this: Pin<&'a T>) -> &'a T { } } -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)] @@ -278,7 +278,7 @@ pub unsafe fn map_unchecked_mut(this: Pin<&'a mut T>, func: F) -> Pin<&'a impl Deref for Pin

{ type Target = P::Target; fn deref(&self) -> &P::Target { - &*self.pointer + Pin::get_ref(Pin::as_ref(self)) } } @@ -288,7 +288,7 @@ impl DerefMut for Pin

P::Target: Unpin { fn deref_mut(&mut self) -> &mut P::Target { - &mut *self.pointer + Pin::get_mut(Pin::as_mut(self)) } }