Skip to content

Commit 9bb2a3a

Browse files
committed
Adjust how it looks in the docs
1 parent d200439 commit 9bb2a3a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

library/core/src/pin.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,7 @@ mod hidden {
17081708
}
17091709

17101710
#[stable(feature = "pin", since = "1.33.0")]
1711+
#[cfg(not(doc))]
17111712
impl<Ptr> DerefMut for Pin<Ptr>
17121713
where
17131714
Ptr: Deref,
@@ -1720,6 +1721,20 @@ where
17201721
}
17211722
}
17221723

1724+
// This impl is only used during documentation, but it is fully equivalent to the above impl with
1725+
// the exception of how the orphan rule treats it.
1726+
#[stable(feature = "pin", since = "1.33.0")]
1727+
#[cfg(doc)]
1728+
impl<Ptr> DerefMut for Pin<Ptr>
1729+
where
1730+
Ptr: DerefMut,
1731+
Ptr::Target: Unpin,
1732+
{
1733+
fn deref_mut(&mut self) -> &mut Ptr::Target {
1734+
Pin::get_mut(Pin::as_mut(self))
1735+
}
1736+
}
1737+
17231738
#[unstable(feature = "deref_pure_trait", issue = "87121")]
17241739
unsafe impl<Ptr: DerefPure> DerefPure for Pin<Ptr> {}
17251740

0 commit comments

Comments
 (0)