]> git.lizzy.rs Git - rust.git/commitdiff
PinMut::get_mut can also preserve the lifetime
authorRalf Jung <post@ralfj.de>
Mon, 7 May 2018 11:20:30 +0000 (13:20 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 7 May 2018 11:20:30 +0000 (13:20 +0200)
src/libcore/mem.rs

index a062ec7ee3df2c2f49c2cf82863a17f57e8f7835..74eb219e45d78f10138a276889393950feea5082 100644 (file)
@@ -1141,7 +1141,7 @@ pub fn borrow<'b>(this: &'b mut PinMut<'a, T>) -> PinMut<'b, T> {
     /// the data out of the mutable reference you receive when you call this
     /// function.
     #[unstable(feature = "pin", issue = "49150")]
-    pub unsafe fn get_mut<'b>(this: &'b mut PinMut<'a, T>) -> &'b mut T {
+    pub unsafe fn get_mut(this: PinMut<'a, T>) -> &'a mut T {
         this.inner
     }