Skip to content

Commit

Permalink
mir: print the scope and span for variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Apr 11, 2016
1 parent b622c3e commit a563711
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_mir/pretty.rs
Expand Up @@ -242,7 +242,11 @@ fn write_mir_intro(tcx: &TyCtxt, nid: NodeId, mir: &Mir, w: &mut Write)
if var.mutability == Mutability::Mut {
write!(w, "mut ")?;
}
writeln!(w, "{:?}: {}; // {}", Lvalue::Var(i as u32), var.ty, var.name)?;
writeln!(w, "{:?}: {}; // {} in {}",
Lvalue::Var(i as u32),
var.ty,
var.name,
comment(tcx, var.scope, var.span))?;
}

// Compiler-introduced temporary types.
Expand Down

0 comments on commit a563711

Please sign in to comment.