Skip to content

Commit bc18857

Browse files
committed
Return &T / &mut T in ManuallyDrop Deref(Mut) impl
Without this change the generated documentation looks like this: fn deref(&self) -> &<ManuallyDrop<T> as Deref>::Target Returning the actual type directly makes the generated docs more clear: fn deref(&self) -> &T
1 parent d586d5d commit bc18857

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/mem.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1018,15 +1018,15 @@ impl<T: ?Sized> ManuallyDrop<T> {
10181018
impl<T: ?Sized> Deref for ManuallyDrop<T> {
10191019
type Target = T;
10201020
#[inline]
1021-
fn deref(&self) -> &Self::Target {
1021+
fn deref(&self) -> &T {
10221022
&self.value
10231023
}
10241024
}
10251025

10261026
#[stable(feature = "manually_drop", since = "1.20.0")]
10271027
impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
10281028
#[inline]
1029-
fn deref_mut(&mut self) -> &mut Self::Target {
1029+
fn deref_mut(&mut self) -> &mut T {
10301030
&mut self.value
10311031
}
10321032
}

0 commit comments

Comments
 (0)