diff --git a/src/librustc_mir/dataflow/generic/graphviz.rs b/src/librustc_mir/dataflow/generic/graphviz.rs index f70564d401913..b805b13592f89 100644 --- a/src/librustc_mir/dataflow/generic/graphviz.rs +++ b/src/librustc_mir/dataflow/generic/graphviz.rs @@ -171,10 +171,19 @@ where // | | (on successful return) | +_4 | // +-+----------------------------------+------------+ - write!( - w, - r#"
"#, + r#" | "#, colspan = num_state_columns, fmt = fmt, )?; @@ -311,7 +320,9 @@ where f: impl FnOnce(&mut Self, &mut W, &str) -> io::Result<()>, ) -> io::Result<()> { let bg = self.toggle_background(); - let fmt = format!("sides=\"tl\" {}", bg.attr()); + let valign = if mir.starts_with("(on ") && mir != "(on entry)" { "bottom" } else { "top" }; + + let fmt = format!("valign=\"{}\" sides=\"tl\" {}", valign, bg.attr()); write!( w, @@ -345,7 +356,7 @@ where colspan = this.num_state_columns(), fmt = fmt, )?; - pretty_print_state_elems(w, analysis, state.iter(), ",", LIMIT_40_ALIGN_1)?; + pretty_print_state_elems(w, analysis, state.iter(), ", ", LIMIT_30_ALIGN_1)?; write!(w, "}} | ") }) } @@ -416,7 +427,7 @@ where } self.prev_loc = location; - write!(w, r#""#, fmt = fmt)?; + write!(w, r#" | "#, fmt = fmt)?; results.seek_after(location); let curr_state = results.get(); write_diff(&mut w, results.analysis(), &self.prev_state, curr_state)?; @@ -524,12 +535,12 @@ where for set in &[&block_trans.gen, &block_trans.kill] { write!( w, - r#" | "#, + r#" | "#, fmt = fmt, rowspan = rowspan )?; - pretty_print_state_elems(&mut w, results.analysis(), set.iter(), "\n", None)?; + pretty_print_state_elems(&mut w, results.analysis(), set.iter(), BR_LEFT, None)?; write!(w, " | ")?; } @@ -561,25 +572,28 @@ fn write_diff