From 997c6a88216ac6a11bb864ab92fa4cf3da72f019 Mon Sep 17 00:00:00 2001 From: Amogh Shivaram Date: Fri, 8 Aug 2025 00:20:55 -0500 Subject: [PATCH] Escape diff strings in graphviz --- compiler/rustc_mir_dataflow/src/framework/graphviz.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_mir_dataflow/src/framework/graphviz.rs b/compiler/rustc_mir_dataflow/src/framework/graphviz.rs index a7d5422a3d721..f86a15a8f9215 100644 --- a/compiler/rustc_mir_dataflow/src/framework/graphviz.rs +++ b/compiler/rustc_mir_dataflow/src/framework/graphviz.rs @@ -800,6 +800,7 @@ where let re = regex!("\t?\u{001f}([+-])"); let raw_diff = format!("{:#?}", DebugDiffWithAdapter { new, old, ctxt }); + let raw_diff = dot::escape_html(&raw_diff); // Replace newlines in the `Debug` output with `
` let raw_diff = raw_diff.replace('\n', r#"
"#);