@@ -708,8 +708,9 @@ impl<'a, T: ?Sized> Pin<&'a T> {
708708impl < ' a , T : ?Sized > Pin < & ' a mut T > {
709709 /// Converts this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
710710 #[ inline( always) ]
711+ #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
711712 #[ stable( feature = "pin" , since = "1.33.0" ) ]
712- pub fn into_ref ( self ) -> Pin < & ' a T > {
713+ pub const fn into_ref ( self ) -> Pin < & ' a T > {
713714 Pin { pointer : self . pointer }
714715 }
715716
@@ -722,9 +723,10 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
722723 /// that lives for as long as the borrow of the `Pin`, not the lifetime of
723724 /// the `Pin` itself. This method allows turning the `Pin` into a reference
724725 /// with the same lifetime as the original `Pin`.
725- #[ stable( feature = "pin" , since = "1.33.0" ) ]
726726 #[ inline( always) ]
727- pub fn get_mut ( self ) -> & ' a mut T
727+ #[ stable( feature = "pin" , since = "1.33.0" ) ]
728+ #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
729+ pub const fn get_mut ( self ) -> & ' a mut T
728730 where
729731 T : Unpin ,
730732 {
@@ -741,9 +743,10 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
741743 ///
742744 /// If the underlying data is `Unpin`, `Pin::get_mut` should be used
743745 /// instead.
744- #[ stable( feature = "pin" , since = "1.33.0" ) ]
745746 #[ inline( always) ]
746- pub unsafe fn get_unchecked_mut ( self ) -> & ' a mut T {
747+ #[ stable( feature = "pin" , since = "1.33.0" ) ]
748+ #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
749+ pub const unsafe fn get_unchecked_mut ( self ) -> & ' a mut T {
747750 self . pointer
748751 }
749752
0 commit comments