@@ -1119,6 +1119,12 @@ impl<'a, T: ?Sized + Unpin> PinMut<'a, T> {
11191119 pub fn new ( reference : & ' a mut T ) -> PinMut < ' a , T > {
11201120 PinMut { inner : reference }
11211121 }
1122+
1123+ /// Get a mutable reference to the data inside of this `PinMut`.
1124+ #[ unstable( feature = "pin" , issue = "49150" ) ]
1125+ pub fn get_mut ( this : PinMut < ' a , T > ) -> & ' a mut T {
1126+ this. inner
1127+ }
11221128}
11231129
11241130
@@ -1150,21 +1156,21 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
11501156 /// the data out of the mutable reference you receive when you call this
11511157 /// function.
11521158 #[ unstable( feature = "pin" , issue = "49150" ) ]
1153- pub unsafe fn get_mut ( this : PinMut < ' a , T > ) -> & ' a mut T {
1159+ pub unsafe fn get_mut_unchecked ( this : PinMut < ' a , T > ) -> & ' a mut T {
11541160 this. inner
11551161 }
11561162
11571163 /// Construct a new pin by mapping the interior value.
11581164 ///
1159- /// For example, if you wanted to get a `PinMut` of a field of something, you
1160- /// could use this to get access to that field in one line of code.
1165+ /// For example, if you wanted to get a `PinMut` of a field of something,
1166+ /// you could use this to get access to that field in one line of code.
11611167 ///
11621168 /// This function is unsafe. You must guarantee that the data you return
11631169 /// will not move so long as the argument value does not move (for example,
11641170 /// because it is one of the fields of that value), and also that you do
11651171 /// not move out of the argument you receive to the interior function.
11661172 #[ unstable( feature = "pin" , issue = "49150" ) ]
1167- pub unsafe fn map < U , F > ( this : PinMut < ' a , T > , f : F ) -> PinMut < ' a , U > where
1173+ pub unsafe fn map_unchecked < U , F > ( this : PinMut < ' a , T > , f : F ) -> PinMut < ' a , U > where
11681174 F : FnOnce ( & mut T ) -> & mut U
11691175 {
11701176 PinMut { inner : f ( this. inner ) }
0 commit comments