File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2957,7 +2957,8 @@ pub struct ProcRes {
2957
2957
}
2958
2958
2959
2959
impl ProcRes {
2960
- pub fn print_info ( & self ) {
2960
+ #[ must_use]
2961
+ pub fn format_info ( & self ) -> String {
2961
2962
fn render ( name : & str , contents : & str ) -> String {
2962
2963
let contents = json:: extract_rendered ( contents) ;
2963
2964
let contents = contents. trim_end ( ) ;
@@ -2973,20 +2974,20 @@ impl ProcRes {
2973
2974
}
2974
2975
}
2975
2976
2976
- println ! (
2977
+ format ! (
2977
2978
"status: {}\n command: {}\n {}\n {}\n " ,
2978
2979
self . status,
2979
2980
self . cmdline,
2980
2981
render( "stdout" , & self . stdout) ,
2981
2982
render( "stderr" , & self . stderr) ,
2982
- ) ;
2983
+ )
2983
2984
}
2984
2985
2985
2986
pub fn fatal ( & self , err : Option < & str > , on_failure : impl FnOnce ( ) ) -> ! {
2986
2987
if let Some ( e) = err {
2987
2988
println ! ( "\n error: {}" , e) ;
2988
2989
}
2989
- self . print_info ( ) ;
2990
+ println ! ( "{}" , self . format_info ( ) ) ;
2990
2991
on_failure ( ) ;
2991
2992
// Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
2992
2993
// compiletest, which is unnecessary noise.
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ impl TestCx<'_> {
31
31
if !res. status . success ( ) {
32
32
self . fatal_proc_rec_with_ctx ( "jsondocck failed!" , & res, |_| {
33
33
println ! ( "Rustdoc Output:" ) ;
34
- proc_res. print_info ( ) ;
34
+ println ! ( "{}" , proc_res. format_info ( ) ) ;
35
35
} )
36
36
}
37
37
You can’t perform that action at this time.
0 commit comments