Preserve output of raw pointers in mir dump.
This commit is contained in:
parent
89cc0467a2
commit
8569dd1db9
1 changed files with 8 additions and 1 deletions
|
@ -2602,9 +2602,16 @@ impl<'tcx> Debug for Constant<'tcx> {
|
|||
impl<'tcx> Display for Constant<'tcx> {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "const ")?;
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> graph::DirectedGraph for Body<'tcx> {
|
||||
type Node = BasicBlock;
|
||||
|
|
Loading…
Add table
Reference in a new issue