File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -610,10 +610,10 @@ unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {}
610
610
///
611
611
/// Instead it can be used to prevent moves through the type system,
612
612
/// by controlling the behavior of special pointer types like [`PinMut`],
613
- /// which "pin" the type in place by not allowing it to be moved out via mutable references .
613
+ /// which "pin" the type in place by not allowing it to be moved out of them .
614
614
///
615
615
/// Implementing this trait lifts the restrictions of pinning off a type,
616
- /// which then allows it to move out of said pointers, with functions such as [`replace`].
616
+ /// which then allows it to move out with functions such as [`replace`].
617
617
///
618
618
/// So this, for example, can only be done on types implementing `Unpin`:
619
619
///
@@ -623,6 +623,8 @@ unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {}
623
623
///
624
624
/// let mut string = "this".to_string();
625
625
/// let mut pinned_string = PinMut::new(&mut string);
626
+ ///
627
+ /// // dereferencing the pointer mutably is only possible because String implements Unpin
626
628
/// replace(&mut *pinned_string, "other".to_string());
627
629
/// ```
628
630
///
You can’t perform that action at this time.
0 commit comments