Skip to content

Commit

Permalink
Relax the Sized bounds on Pin::map_unchecked(_mut)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Jan 6, 2020
1 parent a80e63f commit d288c28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libcore/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
#[stable(feature = "pin", since = "1.33.0")]
pub unsafe fn map_unchecked<U, F>(self, func: F) -> Pin<&'a U>
where
U: ?Sized,
F: FnOnce(&T) -> &U,
{
let pointer = &*self.pointer;
Expand Down Expand Up @@ -763,6 +764,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
#[stable(feature = "pin", since = "1.33.0")]
pub unsafe fn map_unchecked_mut<U, F>(self, func: F) -> Pin<&'a mut U>
where
U: ?Sized,
F: FnOnce(&mut T) -> &mut U,
{
let pointer = Pin::get_unchecked_mut(self);
Expand Down

0 comments on commit d288c28

Please sign in to comment.