diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index bc80c8246ad0f..088c907e13644 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2292,10 +2292,11 @@ impl<'test> TestCx<'test> { let mut normalize_path = |from: &Path, to: &str| { let mut from = from.display().to_string(); + normalized = normalized.replace(&from, to); if json { from = from.replace("\\", "\\\\"); + normalized = normalized.replace(&from, to); } - normalized = normalized.replace(&from, to); }; let parent_dir = self.testpaths.file.parent().unwrap();