Skip to content

Commit a563711

Browse files
committed
mir: print the scope and span for variables.
1 parent b622c3e commit a563711

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_mir/pretty.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ fn write_mir_intro(tcx: &TyCtxt, nid: NodeId, mir: &Mir, w: &mut Write)
242242
if var.mutability == Mutability::Mut {
243243
write!(w, "mut ")?;
244244
}
245-
writeln!(w, "{:?}: {}; // {}", Lvalue::Var(i as u32), var.ty, var.name)?;
245+
writeln!(w, "{:?}: {}; // {} in {}",
246+
Lvalue::Var(i as u32),
247+
var.ty,
248+
var.name,
249+
comment(tcx, var.scope, var.span))?;
246250
}
247251

248252
// Compiler-introduced temporary types.

0 commit comments

Comments
 (0)