From d288c28ff323445e6157b95893072a571009a434 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Mon, 6 Jan 2020 15:41:09 +0100 Subject: [PATCH] Relax the Sized bounds on Pin::map_unchecked(_mut) --- src/libcore/pin.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index aca6fb20138..676d2c784ac 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -672,6 +672,7 @@ impl<'a, T: ?Sized> Pin<&'a T> { #[stable(feature = "pin", since = "1.33.0")] pub unsafe fn map_unchecked(self, func: F) -> Pin<&'a U> where + U: ?Sized, F: FnOnce(&T) -> &U, { let pointer = &*self.pointer; @@ -763,6 +764,7 @@ pub unsafe fn get_unchecked_mut(self) -> &'a mut T { #[stable(feature = "pin", since = "1.33.0")] pub unsafe fn map_unchecked_mut(self, func: F) -> Pin<&'a mut U> where + U: ?Sized, F: FnOnce(&mut T) -> &mut U, { let pointer = Pin::get_unchecked_mut(self);