File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1755,13 +1755,21 @@ where
17551755 }
17561756}
17571757
1758+ /// The `Target` type is restricted to `Unpin` types as it's not safe to obtain a mutable reference
1759+ /// to a pinned value.
1760+ ///
1761+ /// For soundness reasons, implementations of `DerefMut` for `Pin<T>` are rejected even when `T` is
1762+ /// a local type not covered by this impl block. (Since `Pin` is [fundamental], such implementations
1763+ /// would normally be possible.)
1764+ ///
1765+ /// [fundamental]: ../../reference/items/implementations.html#r-items.impl.trait.fundamental
17581766#[ stable( feature = "pin" , since = "1.33.0" ) ]
17591767#[ rustc_const_unstable( feature = "const_convert" , issue = "143773" ) ]
17601768#[ cfg( doc) ]
17611769impl < Ptr > const DerefMut for Pin < Ptr >
17621770where
17631771 Ptr : [ const ] DerefMut ,
1764- Ptr :: Target : Unpin ,
1772+ < Ptr as Deref > :: Target : Unpin ,
17651773{
17661774 fn deref_mut ( & mut self ) -> & mut Ptr :: Target {
17671775 Pin :: get_mut ( Pin :: as_mut ( self ) )
You can’t perform that action at this time.
0 commit comments