Skip to content

Commit 2f501a1

Browse files
committed
fix PinMut documentation
1 parent 1bb0579 commit 2f501a1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/libcore/pin.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ use ops::{Deref, DerefMut, CoerceUnsized};
2424

2525
/// A pinned reference.
2626
///
27-
/// A pinned reference is a lot like a mutable reference, except that it is not
28-
/// safe to move a value out of a pinned reference unless the type of that
29-
/// value implements the `Unpin` trait.
27+
/// This type is similar to a mutable reference, except that it pins its value,
28+
/// which prevents it from moving out of the reference, unless it implements [`Unpin`].
29+
///
30+
/// See the [`pin` module] documentation for furthur explanation on pinning.
31+
///
32+
/// [`Unpin`]: ../marker/trait.Unpin.html
33+
/// [`pin` module]: ../../alloc/pin/index.html
3034
#[unstable(feature = "pin", issue = "49150")]
3135
#[fundamental]
3236
pub struct PinMut<'a, T: ?Sized + 'a> {
@@ -56,7 +60,7 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
5660
/// may or may not implement `Unpin`.
5761
///
5862
/// This constructor is unsafe because we do not know what will happen with
59-
/// that data after the reference ends. If you cannot guarantee that the
63+
/// that data after the lifetime of the reference ends. If you cannot guarantee that the
6064
/// data will never move again, calling this constructor is invalid.
6165
#[unstable(feature = "pin", issue = "49150")]
6266
pub unsafe fn new_unchecked(reference: &'a mut T) -> PinMut<'a, T> {

0 commit comments

Comments
 (0)