diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index 7d8c881eab809..43fb2a5a60290 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -414,11 +414,11 @@ pub struct Pin
{
// Long-term, `unsafe` fields or macro hygiene are expected to offer more robust alternatives.
#[unstable(feature = "unsafe_pin_internals", issue = "none")]
#[doc(hidden)]
- pub pointer: P,
+ pub __pointer: P,
}
// The following implementations aren't derived in order to avoid soundness
-// issues. `&self.pointer` should not be accessible to untrusted trait
+// issues. `&self.__pointer` should not be accessible to untrusted trait
// implementations.
//
// See {
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
#[stable(feature = "pin_into_inner", since = "1.39.0")]
pub const fn into_inner(pin: Pin ) -> P {
- pin.pointer
+ pin.__pointer
}
}
@@ -654,7 +654,7 @@ impl {
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
#[stable(feature = "pin", since = "1.33.0")]
pub const unsafe fn new_unchecked(pointer: P) -> Pin {
- Pin { pointer }
+ Pin { __pointer: pointer }
}
/// Gets a pinned shared reference from this pinned pointer.
@@ -668,7 +668,7 @@ impl {
#[inline(always)]
pub fn as_ref(&self) -> Pin<&P::Target> {
// SAFETY: see documentation on this function
- unsafe { Pin::new_unchecked(&*self.pointer) }
+ unsafe { Pin::new_unchecked(&*self.__pointer) }
}
/// Unwraps this `Pin ` returning the underlying pointer.
@@ -688,7 +688,7 @@ impl {
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
#[stable(feature = "pin_into_inner", since = "1.39.0")]
pub const unsafe fn into_inner_unchecked(pin: Pin ) -> P {
- pin.pointer
+ pin.__pointer
}
}
@@ -725,7 +725,7 @@ impl {
#[inline(always)]
pub fn as_mut(&mut self) -> Pin<&mut P::Target> {
// SAFETY: see documentation on this function
- unsafe { Pin::new_unchecked(&mut *self.pointer) }
+ unsafe { Pin::new_unchecked(&mut *self.__pointer) }
}
/// Assigns a new value to the memory behind the pinned reference.
@@ -750,7 +750,7 @@ impl {
where
P::Target: Sized,
{
- *(self.pointer) = value;
+ *(self.__pointer) = value;
}
}
@@ -776,7 +776,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
U: ?Sized,
F: FnOnce(&T) -> &U,
{
- let pointer = &*self.pointer;
+ let pointer = &*self.__pointer;
let new_pointer = func(pointer);
// SAFETY: the safety contract for `new_unchecked` must be
@@ -806,7 +806,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
#[stable(feature = "pin", since = "1.33.0")]
pub const fn get_ref(self) -> &'a T {
- self.pointer
+ self.__pointer
}
}
@@ -817,7 +817,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
#[stable(feature = "pin", since = "1.33.0")]
pub const fn into_ref(self) -> Pin<&'a T> {
- Pin { pointer: self.pointer }
+ Pin { __pointer: self.__pointer }
}
/// Gets a mutable reference to the data inside of this `Pin`.
@@ -837,7 +837,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
where
T: Unpin,
{
- self.pointer
+ self.__pointer
}
/// Gets a mutable reference to the data inside of this `Pin`.
@@ -855,7 +855,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
#[stable(feature = "pin", since = "1.33.0")]
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
pub const unsafe fn get_unchecked_mut(self) -> &'a mut T {
- self.pointer
+ self.__pointer
}
/// Construct a new pin by mapping the interior value.
@@ -978,21 +978,21 @@ impl {}
#[stable(feature = "pin", since = "1.33.0")]
impl {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt::Debug::fmt(&self.pointer, f)
+ fmt::Debug::fmt(&self.__pointer, f)
}
}
#[stable(feature = "pin", since = "1.33.0")]
impl {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt::Display::fmt(&self.pointer, f)
+ fmt::Display::fmt(&self.__pointer, f)
}
}
#[stable(feature = "pin", since = "1.33.0")]
impl {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- fmt::Pointer::fmt(&self.pointer, f)
+ fmt::Pointer::fmt(&self.__pointer, f)
}
}
@@ -1235,16 +1235,16 @@ pub macro pin($value:expr $(,)?) {
// instead, dropped _at the end of the enscoping block_.
// For instance,
// ```rust
- // let p = Pin { pointer: &mut