Skip to content

Commit 254c155

Browse files
committed
impl fmt::Pointer for &T and &mut T
1 parent 49e1163 commit 254c155

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/libstd/fmt/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,17 @@ impl<T> Pointer for *T {
12001200
}
12011201
impl<T> Pointer for *mut T {
12021202
fn fmt(&self, f: &mut Formatter) -> Result {
1203-
secret_pointer(&(*self as *T), f)
1203+
secret_pointer::<*T>(&(*self as *T), f)
1204+
}
1205+
}
1206+
impl<'a, T> Pointer for &'a T {
1207+
fn fmt(&self, f: &mut Formatter) -> Result {
1208+
secret_pointer::<*T>(&(&**self as *T), f)
1209+
}
1210+
}
1211+
impl<'a, T> Pointer for &'a mut T {
1212+
fn fmt(&self, f: &mut Formatter) -> Result {
1213+
secret_pointer::<*T>(&(&**self as *T), f)
12041214
}
12051215
}
12061216

0 commit comments

Comments
 (0)