Fix pretty-printing for empty tuples in MIR.
This commit is contained in:
parent
21b025f55f
commit
b7fa37d03e
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user