Skip to content

Commit 0050676

Browse files
committed
Rephrase unpin docs in terms of pinning-agnosticness
1 parent 058fb50 commit 0050676

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

library/core/src/marker.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,13 +899,15 @@ marker_impls! {
899899
{T: ?Sized} &mut T,
900900
}
901901

902-
/// Types that do not need to follow the rules of pinning.
902+
/// Types that do not require any pinning guarantees.
903903
///
904904
/// For information on what "pinning" is, see the [`pin` module] documentation.
905905
///
906-
/// Implementing the `Unpin` trait for `T` lifts the restrictions of pinning off that type.
907-
/// This means that, if `T: Unpin`, it cannot be assumed that a value of type `T` will be bound
908-
/// by the invariants that pinning infers, *even* when "pinned" by a [`Pin<Ptr>`] pointing at it.
906+
/// Implementing the `Unpin` trait for `T` expresses the fact that `T` is pinning-agnostic:
907+
/// it shall not expose nor rely on any pinning guarantees. This, in turn, means that a
908+
/// `Pin`-wrapped pointer to such a type can feature a *fully unrestricted* API.
909+
/// In other words, if `T: Unpin`, a value of type `T` will *not* be bound by the invariants
910+
/// which pinning otherwise offers, even when "pinned" by a [`Pin<Ptr>`] pointing at it.
909911
/// When a value of type `T` is pointed at by a [`Pin<Ptr>`], [`Pin`] will not restrict access
910912
/// to the pointee value like it normally would, thus allowing the user to do anything that they
911913
/// normally could with a non-[`Pin`]-wrapped `Ptr` to that value.

0 commit comments

Comments
 (0)