File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ impl<P: Deref> Pin<P> {
154
154
#[ unstable( feature = "pin" , issue = "49150" ) ]
155
155
#[ inline( always) ]
156
156
pub fn as_ref ( self : & Pin < P > ) -> Pin < & P :: Target > {
157
- unsafe { Pin :: new_unchecked ( & * * self ) }
157
+ unsafe { Pin :: new_unchecked ( & * self . pointer ) }
158
158
}
159
159
}
160
160
@@ -212,7 +212,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
212
212
}
213
213
}
214
214
215
- impl < ' a , T > Pin < & ' a mut T > {
215
+ impl < ' a , T : ? Sized > Pin < & ' a mut T > {
216
216
/// Convert this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
217
217
#[ unstable( feature = "pin" , issue = "49150" ) ]
218
218
#[ inline( always) ]
@@ -278,7 +278,7 @@ impl<'a, T> Pin<&'a mut T> {
278
278
impl < P : Deref > Deref for Pin < P > {
279
279
type Target = P :: Target ;
280
280
fn deref ( & self ) -> & P :: Target {
281
- & * self . pointer
281
+ Pin :: get_ref ( Pin :: as_ref ( self ) )
282
282
}
283
283
}
284
284
@@ -288,7 +288,7 @@ where
288
288
P :: Target : Unpin
289
289
{
290
290
fn deref_mut ( & mut self ) -> & mut P :: Target {
291
- & mut * self . pointer
291
+ Pin :: get_mut ( Pin :: as_mut ( self ) )
292
292
}
293
293
}
294
294
You can’t perform that action at this time.
0 commit comments