Skip to content

Commit 72f6c77

Browse files
committed
Adjust error messages
1 parent 578275b commit 72f6c77

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

core/src/pin.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,20 +1711,21 @@ mod helper {
17111711
#[repr(transparent)]
17121712
#[unstable(feature = "pin_derefmut_internals", issue = "none")]
17131713
#[allow(missing_debug_implementations)]
1714-
pub struct Pin<Ptr> {
1714+
pub struct PinHelper<Ptr> {
17151715
pointer: Ptr,
17161716
}
17171717

17181718
#[unstable(feature = "pin_derefmut_internals", issue = "none")]
17191719
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
1720-
pub const trait DerefMut {
1720+
#[rustc_diagnostic_item = "PinDerefMutHelper"]
1721+
pub const trait PinDerefMutHelper {
17211722
type Target: ?Sized;
17221723
fn deref_mut(&mut self) -> &mut Self::Target;
17231724
}
17241725

17251726
#[unstable(feature = "pin_derefmut_internals", issue = "none")]
17261727
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
1727-
impl<Ptr: [const] super::DerefMut> const DerefMut for Pin<Ptr>
1728+
impl<Ptr: [const] super::DerefMut> const PinDerefMutHelper for PinHelper<Ptr>
17281729
where
17291730
Ptr::Target: crate::marker::Unpin,
17301731
{
@@ -1743,14 +1744,14 @@ mod helper {
17431744
impl<Ptr> const DerefMut for Pin<Ptr>
17441745
where
17451746
Ptr: [const] Deref,
1746-
helper::Pin<Ptr>: [const] helper::DerefMut<Target = Self::Target>,
1747+
helper::PinHelper<Ptr>: [const] helper::PinDerefMutHelper<Target = Self::Target>,
17471748
{
17481749
#[inline]
17491750
fn deref_mut(&mut self) -> &mut Ptr::Target {
1750-
// SAFETY: Pin and helper::Pin have the same layout, so this is equivalent to
1751+
// SAFETY: Pin and PinHelper have the same layout, so this is equivalent to
17511752
// `&mut self.pointer` which is safe because `Target: Unpin`.
1752-
helper::DerefMut::deref_mut(unsafe {
1753-
&mut *(self as *mut Pin<Ptr> as *mut helper::Pin<Ptr>)
1753+
helper::PinDerefMutHelper::deref_mut(unsafe {
1754+
&mut *(self as *mut Pin<Ptr> as *mut helper::PinHelper<Ptr>)
17541755
})
17551756
}
17561757
}

0 commit comments

Comments
 (0)