about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/mem.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index 74eb219e45d..6cbe26afae9 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -1129,10 +1129,13 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
         PinMut { inner: reference }
     }
 
-    /// Borrow a PinMut for a shorter lifetime than it already has.
+    /// Reborrow a `PinMut` for a shorter lifetime.
+    ///
+    /// For example, `PinMut::get_mut(x.reborrow())` (unsafely) returns a
+    /// short-lived mutable reference reborrowing from `x`.
     #[unstable(feature = "pin", issue = "49150")]
-    pub fn borrow<'b>(this: &'b mut PinMut<'a, T>) -> PinMut<'b, T> {
-        PinMut { inner: this.inner }
+    pub fn reborrow<'b>(&'b mut self) -> PinMut<'b, T> {
+        PinMut { inner: self.inner }
     }
 
     /// Get a mutable reference to the data inside of this `PinMut`.