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 @@ -2958,7 +2958,8 @@ pub struct ProcRes {
29582958}
29592959
29602960impl ProcRes {
2961- pub fn print_info ( & self ) {
2961+ #[ must_use]
2962+ pub fn format_info ( & self ) -> String {
29622963 fn render ( name : & str , contents : & str ) -> String {
29632964 let contents = json:: extract_rendered ( contents) ;
29642965 let contents = contents. trim_end ( ) ;
@@ -2974,20 +2975,20 @@ impl ProcRes {
29742975 }
29752976 }
29762977
2977- println ! (
2978+ format ! (
29782979 "status: {}\n command: {}\n {}\n {}\n " ,
29792980 self . status,
29802981 self . cmdline,
29812982 render( "stdout" , & self . stdout) ,
29822983 render( "stderr" , & self . stderr) ,
2983- ) ;
2984+ )
29842985 }
29852986
29862987 pub fn fatal ( & self , err : Option < & str > , on_failure : impl FnOnce ( ) ) -> ! {
29872988 if let Some ( e) = err {
29882989 println ! ( "\n error: {}" , e) ;
29892990 }
2990- self . print_info ( ) ;
2991+ println ! ( "{}" , self . format_info ( ) ) ;
29912992 on_failure ( ) ;
29922993 // Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
29932994 // compiletest, which is unnecessary noise.
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ impl TestCx<'_> {
3131 if !res. status . success ( ) {
3232 self . fatal_proc_rec_with_ctx ( "jsondocck failed!" , & res, |_| {
3333 println ! ( "Rustdoc Output:" ) ;
34- proc_res. print_info ( ) ;
34+ println ! ( "{}" , proc_res. format_info ( ) ) ;
3535 } )
3636 }
3737
You can’t perform that action at this time.
0 commit comments