mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Preserve output of raw pointers in mir dump.
This commit is contained in:
@@ -2602,7 +2602,14 @@ fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
|
||||
impl<'tcx> Display for Constant<'tcx> {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "const ")?;
|
||||
write!(fmt, "{}", self.literal)
|
||||
// FIXME make the default pretty printing of raw pointers more detailed. Here we output the
|
||||
// debug representation of raw pointers, so that the raw pointers in the mir dump output are
|
||||
// detailed and just not '{pointer}'.
|
||||
if let ty::RawPtr(_) = self.literal.ty.kind {
|
||||
write!(fmt, "{:?} : {}", self.literal.val, self.literal.ty)
|
||||
} else {
|
||||
write!(fmt, "{}", self.literal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user