about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2018-05-07 12:51:59 +0200
committerRalf Jung <post@ralfj.de>2018-05-07 12:51:59 +0200
commit84ce206db6a1b452c3277963e8eafd99baba0668 (patch)
treeb58384b0979ae2a3be7fc40ee9133062a8f5a7f9
parent9f26376281035fde5bf332a4326fadcdb48b7ef7 (diff)
downloadrust-84ce206db6a1b452c3277963e8eafd99baba0668.tar.gz
rust-84ce206db6a1b452c3277963e8eafd99baba0668.zip
Change PinMut::map to be able to preserve the original reference's lifetime
Suggested by @dylanede at <https://github.com/rust-lang/rust/issues/49150#issuecomment-381071442>.
-rw-r--r--src/libcore/mem.rs2
1 files changed, 1 insertions, 1 deletions
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<U, F>(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where
         F: FnOnce(&mut T) -> &mut U
     {
         PinMut { inner: f(this.inner) }