File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -62,19 +62,20 @@ struct DiagnosticCode {
62
62
explanation : Option < String > ,
63
63
}
64
64
65
- pub fn extract_rendered ( output : & str , proc_res : & ProcRes ) -> String {
65
+ pub fn extract_rendered ( output : & str ) -> String {
66
66
output
67
67
. lines ( )
68
68
. filter_map ( |line| {
69
69
if line. starts_with ( '{' ) {
70
70
match serde_json:: from_str :: < Diagnostic > ( line) {
71
71
Ok ( diagnostic) => diagnostic. rendered ,
72
72
Err ( error) => {
73
- proc_res . fatal ( Some ( & format ! (
73
+ print ! (
74
74
"failed to decode compiler output as json: \
75
75
`{}`\n line: {}\n output: {}",
76
76
error, line, output
77
- ) ) ) ;
77
+ ) ;
78
+ panic ! ( )
78
79
}
79
80
}
80
81
} else {
Original file line number Diff line number Diff line change @@ -2760,7 +2760,7 @@ impl<'test> TestCx<'test> {
2760
2760
let stderr = if explicit {
2761
2761
proc_res. stderr . clone ( )
2762
2762
} else {
2763
- json:: extract_rendered ( & proc_res. stderr , & proc_res )
2763
+ json:: extract_rendered ( & proc_res. stderr )
2764
2764
} ;
2765
2765
2766
2766
let normalized_stderr = self . normalize_output ( & stderr, & self . props . normalize_stderr ) ;
@@ -3377,7 +3377,9 @@ impl ProcRes {
3377
3377
{}\n \
3378
3378
------------------------------------------\n \
3379
3379
\n ",
3380
- self . status, self . cmdline, self . stdout, self . stderr
3380
+ self . status, self . cmdline,
3381
+ json:: extract_rendered( & self . stdout) ,
3382
+ json:: extract_rendered( & self . stderr) ,
3381
3383
) ;
3382
3384
panic ! ( ) ;
3383
3385
}
You can’t perform that action at this time.
0 commit comments