File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 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 {}
610610///
611611/// Instead it can be used to prevent moves through the type system,
612612/// 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 .
614614///
615615/// 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`].
617617///
618618/// So this, for example, can only be done on types implementing `Unpin`:
619619///
@@ -623,6 +623,8 @@ unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {}
623623///
624624/// let mut string = "this".to_string();
625625/// let mut pinned_string = PinMut::new(&mut string);
626+ ///
627+ /// // dereferencing the pointer mutably is only possible because String implements Unpin
626628/// replace(&mut *pinned_string, "other".to_string());
627629/// ```
628630///
You can’t perform that action at this time.
0 commit comments