Skip to content

Commit 3864d89

Browse files
committed
Address PR comments
1 parent ddaf523 commit 3864d89

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/libsyntax/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl Diagnostic {
200200
children: db.children.iter().map(|c| {
201201
Diagnostic::from_sub_diagnostic(c, je)
202202
}).chain(sugg).collect(),
203-
rendered: Some(output.to_owned()),
203+
rendered: Some(output),
204204
}
205205
}
206206

src/tools/compiletest/src/runtest.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2411,7 +2411,11 @@ actual:\n\
24112411
let mut normalized = output.replace(&parent_dir_str, "$DIR");
24122412

24132413
if json {
2414-
normalized = normalized.replace("\\n", "\n"); // verbatim newline in json strings
2414+
// escaped newlines in json strings should be readable
2415+
// in the stderr files. There's no point int being correct,
2416+
// since only humans process the stderr files.
2417+
// Thus we just turn escaped newlines back into newlines.
2418+
normalized = normalized.replace("\\n", "\n");
24152419
}
24162420

24172421
normalized = normalized.replace("\\\\", "\\") // denormalize for paths on windows

0 commit comments

Comments
 (0)