@@ -708,8 +708,9 @@ impl<'a, T: ?Sized> Pin<&'a T> {
708
708
impl < ' a , T : ?Sized > Pin < & ' a mut T > {
709
709
/// Converts this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
710
710
#[ inline( always) ]
711
+ #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
711
712
#[ 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 > {
713
714
Pin { pointer : self . pointer }
714
715
}
715
716
@@ -722,9 +723,10 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
722
723
/// that lives for as long as the borrow of the `Pin`, not the lifetime of
723
724
/// the `Pin` itself. This method allows turning the `Pin` into a reference
724
725
/// with the same lifetime as the original `Pin`.
725
- #[ stable( feature = "pin" , since = "1.33.0" ) ]
726
726
#[ 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
728
730
where
729
731
T : Unpin ,
730
732
{
@@ -741,9 +743,10 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
741
743
///
742
744
/// If the underlying data is `Unpin`, `Pin::get_mut` should be used
743
745
/// instead.
744
- #[ stable( feature = "pin" , since = "1.33.0" ) ]
745
746
#[ 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 {
747
750
self . pointer
748
751
}
749
752
0 commit comments