From 84ce206db6a1b452c3277963e8eafd99baba0668 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 7 May 2018 12:51:59 +0200 Subject: [PATCH] Change PinMut::map to be able to preserve the original reference's lifetime Suggested by @dylanede at . --- src/libcore/mem.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 5d344c48cb8..a062ec7ee3d 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -1155,7 +1155,7 @@ impl<'a, T: ?Sized> PinMut<'a, T> { /// because it is one of the fields of that value), and also that you do /// not move out of the argument you receive to the interior function. #[unstable(feature = "pin", issue = "49150")] - pub unsafe fn map<'b, U, F>(this: &'b mut PinMut<'a, T>, f: F) -> PinMut<'b, U> where + pub unsafe fn map(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where F: FnOnce(&mut T) -> &mut U { PinMut { inner: f(this.inner) }