Skip to content

Commit 00efc94

Browse files
authored
Rollup merge of #113189 - Zalathar:trim-end, r=ozkanonur
compiletest: Only trim the end of process output As of #94196, compiletest automatically trims process stderr/stdout output before printing it, to make failure info more compact. This causes the first line of `run-coverage` output to be displayed incorrectly, because it uses leading whitespace to align line numbers. Trimming only the end of the output string should still have the intended effect (e.g. removing trailing newlines), without causing problems for output that deliberately uses leading whitespace on the first line. ## Before ``` --- stdout ------------------------------- 1| 1|fn main() { // 2| 1| let num = 9; 3| 1| while num >= 10 { 4| 0| } 5| 1|} ------------------------------------------ stderr: none ``` ## After ``` --- stdout ------------------------------- 1| 1|fn main() { // 2| 1| let num = 9; 3| 1| while num >= 10 { 4| 0| } 5| 1|} ------------------------------------------ stderr: none ```
2 parents e116530 + 115cfda commit 00efc94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/compiletest/src/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4374,7 +4374,7 @@ impl ProcRes {
43744374
pub fn print_info(&self) {
43754375
fn render(name: &str, contents: &str) -> String {
43764376
let contents = json::extract_rendered(contents);
4377-
let contents = contents.trim();
4377+
let contents = contents.trim_end();
43784378
if contents.is_empty() {
43794379
format!("{name}: none")
43804380
} else {

0 commit comments

Comments
 (0)