Fix pretty-printing for empty tuples in MIR.

This commit is contained in:
Scott Olson 2016-01-06 14:17:38 -06:00
parent 21b025f55f
commit b7fa37d03e

View File

@ -804,10 +804,10 @@ fn fmt_tuple(fmt: &mut Formatter, name: &str, lvs: &[Operand]) -> fmt::Result {
Vec => write!(fmt, "{:?}", lvs),
Tuple => {
if lvs.len() == 1 {
write!(fmt, "({:?},)", lvs[0])
} else {
fmt_tuple(fmt, "", lvs)
match lvs.len() {
0 => write!(fmt, "()"),
1 => write!(fmt, "({:?},)", lvs[0]),
_ => fmt_tuple(fmt, "", lvs),
}
}