提交 254c155f 编写于 作者: C Corey Richardson

impl fmt::Pointer for &T and &mut T

上级 49e11630
......@@ -1200,7 +1200,17 @@ fn fmt(&self, f: &mut Formatter) -> Result {
}
impl<T> Pointer for *mut T {
fn fmt(&self, f: &mut Formatter) -> Result {
secret_pointer(&(*self as *T), f)
secret_pointer::<*T>(&(*self as *T), f)
}
}
impl<'a, T> Pointer for &'a T {
fn fmt(&self, f: &mut Formatter) -> Result {
secret_pointer::<*T>(&(&**self as *T), f)
}
}
impl<'a, T> Pointer for &'a mut T {
fn fmt(&self, f: &mut Formatter) -> Result {
secret_pointer::<*T>(&(&**self as *T), f)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册