diff --git a/test-package-compiler/src/lib.rs b/test-package-compiler/src/lib.rs index dbd3560ea..af60f7d92 100644 --- a/test-package-compiler/src/lib.rs +++ b/test-package-compiler/src/lib.rs @@ -134,7 +134,11 @@ impl TestCompileOutput { Regex::new(r#"-file\("([^"]+)", (\d+)\)\."#).expect("Invalid regex") }) .replace_all(text, |caps: ®ex::Captures| { - let path = caps.get(1).expect("file path").as_str().replace("\\", "/"); + let path = caps + .get(1) + .expect("file path") + .as_str() + .replace("\\\\", "/"); let line_number = caps.get(2).expect("line number").as_str(); format!("-file(\"{}\", {}).", path, line_number) });