Skip to content

Commit 78a856b

Browse files
Fix "let mut let mut" in MIR CFG graphviz output
1 parent baa2d07 commit 78a856b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc_mir/util/graphviz.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,11 @@ fn write_graph_label<'a, 'tcx, W: Write>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
154154
write!(w, "mut ")?;
155155
}
156156

157+
write!(w, "{:?}: {};", Lvalue::Local(local), escape(&decl.ty))?;
157158
if let Some(name) = decl.name {
158-
write!(w, r#"{:?}: {}; // {}<br align="left"/>"#,
159-
Lvalue::Local(local), escape(&decl.ty), name)?;
160-
} else {
161-
write!(w, r#"let mut {:?}: {};<br align="left"/>"#,
162-
Lvalue::Local(local), escape(&decl.ty))?;
159+
write!(w, " // {}", name)?;
163160
}
161+
write!(w, r#"<br align="left"/>"#)?;
164162
}
165163

166164
writeln!(w, ">;")

0 commit comments

Comments
 (0)