Skip to content

Commit 4d0e8c9

Browse files
authored
Rollup merge of rust-lang#145080 - ashivaram23:graphviz_escape, r=lqd
Escape diff strings in MIR dataflow graphviz This uses `dot::escape_html` on diff strings so that `<` and `>` are properly escaped in MIR dataflow graphviz. Previously the output could be malformed. For example, the graphviz for borrow check `MaybeInitializedPlaces` for the example in rust-lang#145032 contained an unescaped `Fork<'_>`.
2 parents f7c3a97 + 997c6a8 commit 4d0e8c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_dataflow/src/framework/graphviz.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ where
800800
let re = regex!("\t?\u{001f}([+-])");
801801

802802
let raw_diff = format!("{:#?}", DebugDiffWithAdapter { new, old, ctxt });
803+
let raw_diff = dot::escape_html(&raw_diff);
803804

804805
// Replace newlines in the `Debug` output with `<br/>`
805806
let raw_diff = raw_diff.replace('\n', r#"<br align="left"/>"#);

0 commit comments

Comments
 (0)