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 ```
This commit is contained in:
commit
00efc94a6c
1 changed files with 1 additions and 1 deletions
|
@ -4374,7 +4374,7 @@ impl ProcRes {
|
|||
pub fn print_info(&self) {
|
||||
fn render(name: &str, contents: &str) -> String {
|
||||
let contents = json::extract_rendered(contents);
|
||||
let contents = contents.trim();
|
||||
let contents = contents.trim_end();
|
||||
if contents.is_empty() {
|
||||
format!("{name}: none")
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue