File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1755,13 +1755,18 @@ where
1755
1755
}
1756
1756
}
1757
1757
1758
+ /// Restricted to `Unpin` types, as it's not safe to obtain a mutable reference to a pinned value.
1759
+ ///
1760
+ /// Note that because `Pin` is fundamental, it would normally be possible for crates to implement
1761
+ /// `DerefMut` for `Pin<T>` when `T` is a local type and not covered by this impl block. However,
1762
+ /// this impl block is written in a special way to prevent that for soundness reasons.
1758
1763
#[ stable( feature = "pin" , since = "1.33.0" ) ]
1759
1764
#[ rustc_const_unstable( feature = "const_convert" , issue = "143773" ) ]
1760
1765
#[ cfg( doc) ]
1761
1766
impl < Ptr > const DerefMut for Pin < Ptr >
1762
1767
where
1763
1768
Ptr : [ const ] DerefMut ,
1764
- Ptr :: Target : Unpin ,
1769
+ < Ptr as Deref > :: Target : Unpin ,
1765
1770
{
1766
1771
fn deref_mut ( & mut self ) -> & mut Ptr :: Target {
1767
1772
Pin :: get_mut ( Pin :: as_mut ( self ) )
You can’t perform that action at this time.
0 commit comments