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
1755
1755
}
1756
1756
}
1757
1757
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
1758
1766
#[ stable( feature = "pin" , since = "1.33.0" ) ]
1759
1767
#[ rustc_const_unstable( feature = "const_convert" , issue = "143773" ) ]
1760
1768
#[ cfg( doc) ]
1761
1769
impl < Ptr > const DerefMut for Pin < Ptr >
1762
1770
where
1763
1771
Ptr : [ const ] DerefMut ,
1764
- Ptr :: Target : Unpin ,
1772
+ < Ptr as Deref > :: Target : Unpin ,
1765
1773
{
1766
1774
fn deref_mut ( & mut self ) -> & mut Ptr :: Target {
1767
1775
Pin :: get_mut ( Pin :: as_mut ( self ) )
You can’t perform that action at this time.
0 commit comments