We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89cc046 commit 8569dd1Copy full SHA for 8569dd1
src/librustc/mir/mod.rs
@@ -2602,7 +2602,14 @@ impl<'tcx> Debug for Constant<'tcx> {
2602
impl<'tcx> Display for Constant<'tcx> {
2603
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
2604
write!(fmt, "const ")?;
2605
- write!(fmt, "{}", self.literal)
+ // FIXME make the default pretty printing of raw pointers more detailed. Here we output the
2606
+ // debug representation of raw pointers, so that the raw pointers in the mir dump output are
2607
+ // detailed and just not '{pointer}'.
2608
+ if let ty::RawPtr(_) = self.literal.ty.kind {
2609
+ write!(fmt, "{:?} : {}", self.literal.val, self.literal.ty)
2610
+ } else {
2611
+ write!(fmt, "{}", self.literal)
2612
+ }
2613
}
2614
2615
0 commit comments