Skip to content

Commit b7fa37d

Browse files
committed
Fix pretty-printing for empty tuples in MIR.
1 parent 21b025f commit b7fa37d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/mir/repr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,10 @@ impl<'tcx> Debug for Rvalue<'tcx> {
804804
Vec => write!(fmt, "{:?}", lvs),
805805

806806
Tuple => {
807-
if lvs.len() == 1 {
808-
write!(fmt, "({:?},)", lvs[0])
809-
} else {
810-
fmt_tuple(fmt, "", lvs)
807+
match lvs.len() {
808+
0 => write!(fmt, "()"),
809+
1 => write!(fmt, "({:?},)", lvs[0]),
810+
_ => fmt_tuple(fmt, "", lvs),
811811
}
812812
}
813813

0 commit comments

Comments
 (0)