@@ -414,11 +414,11 @@ pub struct Pin<P> {
414
414
// Long-term, `unsafe` fields or macro hygiene are expected to offer more robust alternatives.
415
415
#[ unstable( feature = "unsafe_pin_internals" , issue = "none" ) ]
416
416
#[ doc( hidden) ]
417
- pub pointer : P ,
417
+ pub __pointer : P ,
418
418
}
419
419
420
420
// The following implementations aren't derived in order to avoid soundness
421
- // issues. `&self.pointer ` should not be accessible to untrusted trait
421
+ // issues. `&self.__pointer ` should not be accessible to untrusted trait
422
422
// implementations.
423
423
//
424
424
// See <https://internals.rust-lang.org/t/unsoundness-in-pin/11311/73> for more details.
@@ -525,7 +525,7 @@ impl<P: Deref<Target: Unpin>> Pin<P> {
525
525
#[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
526
526
#[ stable( feature = "pin_into_inner" , since = "1.39.0" ) ]
527
527
pub const fn into_inner ( pin : Pin < P > ) -> P {
528
- pin. pointer
528
+ pin. __pointer
529
529
}
530
530
}
531
531
@@ -654,7 +654,7 @@ impl<P: Deref> Pin<P> {
654
654
#[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
655
655
#[ stable( feature = "pin" , since = "1.33.0" ) ]
656
656
pub const unsafe fn new_unchecked ( pointer : P ) -> Pin < P > {
657
- Pin { pointer }
657
+ Pin { __pointer : pointer }
658
658
}
659
659
660
660
/// Gets a pinned shared reference from this pinned pointer.
@@ -668,7 +668,7 @@ impl<P: Deref> Pin<P> {
668
668
#[ inline( always) ]
669
669
pub fn as_ref ( & self ) -> Pin < & P :: Target > {
670
670
// SAFETY: see documentation on this function
671
- unsafe { Pin :: new_unchecked ( & * self . pointer ) }
671
+ unsafe { Pin :: new_unchecked ( & * self . __pointer ) }
672
672
}
673
673
674
674
/// Unwraps this `Pin<P>` returning the underlying pointer.
@@ -688,7 +688,7 @@ impl<P: Deref> Pin<P> {
688
688
#[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
689
689
#[ stable( feature = "pin_into_inner" , since = "1.39.0" ) ]
690
690
pub const unsafe fn into_inner_unchecked ( pin : Pin < P > ) -> P {
691
- pin. pointer
691
+ pin. __pointer
692
692
}
693
693
}
694
694
@@ -725,7 +725,7 @@ impl<P: DerefMut> Pin<P> {
725
725
#[ inline( always) ]
726
726
pub fn as_mut ( & mut self ) -> Pin < & mut P :: Target > {
727
727
// SAFETY: see documentation on this function
728
- unsafe { Pin :: new_unchecked ( & mut * self . pointer ) }
728
+ unsafe { Pin :: new_unchecked ( & mut * self . __pointer ) }
729
729
}
730
730
731
731
/// Assigns a new value to the memory behind the pinned reference.
@@ -750,7 +750,7 @@ impl<P: DerefMut> Pin<P> {
750
750
where
751
751
P :: Target : Sized ,
752
752
{
753
- * ( self . pointer ) = value;
753
+ * ( self . __pointer ) = value;
754
754
}
755
755
}
756
756
@@ -776,7 +776,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
776
776
U : ?Sized ,
777
777
F : FnOnce ( & T ) -> & U ,
778
778
{
779
- let pointer = & * self . pointer ;
779
+ let pointer = & * self . __pointer ;
780
780
let new_pointer = func ( pointer) ;
781
781
782
782
// SAFETY: the safety contract for `new_unchecked` must be
@@ -806,7 +806,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
806
806
#[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
807
807
#[ stable( feature = "pin" , since = "1.33.0" ) ]
808
808
pub const fn get_ref ( self ) -> & ' a T {
809
- self . pointer
809
+ self . __pointer
810
810
}
811
811
}
812
812
@@ -817,7 +817,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
817
817
#[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
818
818
#[ stable( feature = "pin" , since = "1.33.0" ) ]
819
819
pub const fn into_ref ( self ) -> Pin < & ' a T > {
820
- Pin { pointer : self . pointer }
820
+ Pin { __pointer : self . __pointer }
821
821
}
822
822
823
823
/// Gets a mutable reference to the data inside of this `Pin`.
@@ -837,7 +837,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
837
837
where
838
838
T : Unpin ,
839
839
{
840
- self . pointer
840
+ self . __pointer
841
841
}
842
842
843
843
/// Gets a mutable reference to the data inside of this `Pin`.
@@ -855,7 +855,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
855
855
#[ stable( feature = "pin" , since = "1.33.0" ) ]
856
856
#[ rustc_const_unstable( feature = "const_pin" , issue = "76654" ) ]
857
857
pub const unsafe fn get_unchecked_mut ( self ) -> & ' a mut T {
858
- self . pointer
858
+ self . __pointer
859
859
}
860
860
861
861
/// Construct a new pin by mapping the interior value.
@@ -978,21 +978,21 @@ impl<P: Receiver> Receiver for Pin<P> {}
978
978
#[ stable( feature = "pin" , since = "1.33.0" ) ]
979
979
impl < P : fmt:: Debug > fmt:: Debug for Pin < P > {
980
980
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
981
- fmt:: Debug :: fmt ( & self . pointer , f)
981
+ fmt:: Debug :: fmt ( & self . __pointer , f)
982
982
}
983
983
}
984
984
985
985
#[ stable( feature = "pin" , since = "1.33.0" ) ]
986
986
impl < P : fmt:: Display > fmt:: Display for Pin < P > {
987
987
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
988
- fmt:: Display :: fmt ( & self . pointer , f)
988
+ fmt:: Display :: fmt ( & self . __pointer , f)
989
989
}
990
990
}
991
991
992
992
#[ stable( feature = "pin" , since = "1.33.0" ) ]
993
993
impl < P : fmt:: Pointer > fmt:: Pointer for Pin < P > {
994
994
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
995
- fmt:: Pointer :: fmt ( & self . pointer , f)
995
+ fmt:: Pointer :: fmt ( & self . __pointer , f)
996
996
}
997
997
}
998
998
@@ -1235,16 +1235,16 @@ pub macro pin($value:expr $(,)?) {
1235
1235
// instead, dropped _at the end of the enscoping block_.
1236
1236
// For instance,
1237
1237
// ```rust
1238
- // let p = Pin { pointer : &mut <temporary> };
1238
+ // let p = Pin { __pointer : &mut <temporary> };
1239
1239
// ```
1240
1240
// becomes:
1241
1241
// ```rust
1242
1242
// let mut anon = <temporary>;
1243
- // let p = Pin { pointer : &mut anon };
1243
+ // let p = Pin { __pointer : &mut anon };
1244
1244
// ```
1245
1245
// which is *exactly* what we want.
1246
1246
//
1247
1247
// See https://doc.rust-lang.org/1.58.1/reference/destructors.html#temporary-lifetime-extension
1248
1248
// for more info.
1249
- $crate:: pin:: Pin :: < & mut _ > { pointer : & mut { $value } }
1249
+ $crate:: pin:: Pin :: < & mut _ > { __pointer : & mut { $value } }
1250
1250
}
0 commit comments