@@ -956,7 +956,7 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
956956#[ stable( feature = "manually_drop" , since = "1.20.0" ) ]
957957#[ lang = "manually_drop" ]
958958#[ derive( Copy , Clone , Debug , Default , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
959- pub struct ManuallyDrop < T > {
959+ pub struct ManuallyDrop < T : ? Sized > {
960960 value : T ,
961961}
962962
@@ -990,7 +990,9 @@ impl<T> ManuallyDrop<T> {
990990 pub fn into_inner ( slot : ManuallyDrop < T > ) -> T {
991991 slot. value
992992 }
993+ }
993994
995+ impl < T : ?Sized > ManuallyDrop < T > {
994996 /// Manually drops the contained value.
995997 ///
996998 /// # Safety
@@ -1006,7 +1008,7 @@ impl<T> ManuallyDrop<T> {
10061008}
10071009
10081010#[ stable( feature = "manually_drop" , since = "1.20.0" ) ]
1009- impl < T > Deref for ManuallyDrop < T > {
1011+ impl < T : ? Sized > Deref for ManuallyDrop < T > {
10101012 type Target = T ;
10111013 #[ inline]
10121014 fn deref ( & self ) -> & Self :: Target {
@@ -1015,13 +1017,16 @@ impl<T> Deref for ManuallyDrop<T> {
10151017}
10161018
10171019#[ stable( feature = "manually_drop" , since = "1.20.0" ) ]
1018- impl < T > DerefMut for ManuallyDrop < T > {
1020+ impl < T : ? Sized > DerefMut for ManuallyDrop < T > {
10191021 #[ inline]
10201022 fn deref_mut ( & mut self ) -> & mut Self :: Target {
10211023 & mut self . value
10221024 }
10231025}
10241026
1027+ #[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
1028+ impl < T : CoerceUnsized < U > , U > CoerceUnsized < ManuallyDrop < U > > for ManuallyDrop < T > { }
1029+
10251030/// A pinned reference.
10261031///
10271032/// A pinned reference is a lot like a mutable reference, except that it is not
0 commit comments