Skip to content

Commit

Permalink
Rename PinMut::borrow to PinMut::reborrow and make it a method
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 7, 2018
1 parent 17206a7 commit 8619e19
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/libcore/mem.rs
Expand Up @@ -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`.
Expand Down

0 comments on commit 8619e19

Please sign in to comment.