Skip to content

Commit 8619e19

Browse files
committed
Rename PinMut::borrow to PinMut::reborrow and make it a method
1 parent 17206a7 commit 8619e19

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/libcore/mem.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1129,10 +1129,13 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
11291129
PinMut { inner: reference }
11301130
}
11311131

1132-
/// Borrow a PinMut for a shorter lifetime than it already has.
1132+
/// Reborrow a `PinMut` for a shorter lifetime.
1133+
///
1134+
/// For example, `PinMut::get_mut(x.reborrow())` (unsafely) returns a
1135+
/// short-lived mutable reference reborrowing from `x`.
11331136
#[unstable(feature = "pin", issue = "49150")]
1134-
pub fn borrow<'b>(this: &'b mut PinMut<'a, T>) -> PinMut<'b, T> {
1135-
PinMut { inner: this.inner }
1137+
pub fn reborrow<'b>(&'b mut self) -> PinMut<'b, T> {
1138+
PinMut { inner: self.inner }
11361139
}
11371140

11381141
/// Get a mutable reference to the data inside of this `PinMut`.

0 commit comments

Comments
 (0)