@@ -715,6 +715,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
715715impl < ' a , T : ?Sized > Pin < & ' a mut T > {
716716 /// Converts this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
717717 #[ inline( always) ]
718+ #[ must_use = "`self` will be dropped if the result is not used" ]
718719 #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
719720 #[ stable( feature = "pin" , since = "1.33.0" ) ]
720721 pub const fn into_ref ( self ) -> Pin < & ' a T > {
@@ -731,6 +732,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
731732 /// the `Pin` itself. This method allows turning the `Pin` into a reference
732733 /// with the same lifetime as the original `Pin`.
733734 #[ inline( always) ]
735+ #[ must_use = "`self` will be dropped if the result is not used" ]
734736 #[ stable( feature = "pin" , since = "1.33.0" ) ]
735737 #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
736738 pub const fn get_mut ( self ) -> & ' a mut T
@@ -751,6 +753,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
751753 /// If the underlying data is `Unpin`, `Pin::get_mut` should be used
752754 /// instead.
753755 #[ inline( always) ]
756+ #[ must_use = "`self` will be dropped if the result is not used" ]
754757 #[ stable( feature = "pin" , since = "1.33.0" ) ]
755758 #[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
756759 pub const unsafe fn get_unchecked_mut ( self ) -> & ' a mut T {
@@ -772,6 +775,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
772775 /// not move out of the argument you receive to the interior function.
773776 ///
774777 /// [`pin` module]: self#projections-and-structural-pinning
778+ #[ must_use = "`self` will be dropped if the result is not used" ]
775779 #[ stable( feature = "pin" , since = "1.33.0" ) ]
776780 pub unsafe fn map_unchecked_mut < U , F > ( self , func : F ) -> Pin < & ' a mut U >
777781 where
@@ -811,6 +815,7 @@ impl<'a, P: DerefMut> Pin<&'a mut Pin<P>> {
811815 /// implementations of `P::DerefMut` are likewise ruled out by the contract of
812816 /// `Pin::new_unchecked`.
813817 #[ unstable( feature = "pin_deref_mut" , issue = "86918" ) ]
818+ #[ must_use = "`self` will be dropped if the result is not used" ]
814819 #[ inline( always) ]
815820 pub fn as_deref_mut ( self ) -> Pin < & ' a mut P :: Target > {
816821 // SAFETY: What we're asserting here is that going from
0 commit comments