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 {
29572957}
29582958
29592959impl ProcRes {
2960- pub fn print_info ( & self ) {
2960+ #[ must_use]
2961+ pub fn format_info ( & self ) -> String {
29612962 fn render ( name : & str , contents : & str ) -> String {
29622963 let contents = json:: extract_rendered ( contents) ;
29632964 let contents = contents. trim_end ( ) ;
@@ -2973,20 +2974,20 @@ impl ProcRes {
29732974 }
29742975 }
29752976
2976- println ! (
2977+ format ! (
29772978 "status: {}\n command: {}\n {}\n {}\n " ,
29782979 self . status,
29792980 self . cmdline,
29802981 render( "stdout" , & self . stdout) ,
29812982 render( "stderr" , & self . stderr) ,
2982- ) ;
2983+ )
29832984 }
29842985
29852986 pub fn fatal ( & self , err : Option < & str > , on_failure : impl FnOnce ( ) ) -> ! {
29862987 if let Some ( e) = err {
29872988 println ! ( "\n error: {}" , e) ;
29882989 }
2989- self . print_info ( ) ;
2990+ println ! ( "{}" , self . format_info ( ) ) ;
29902991 on_failure ( ) ;
29912992 // Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
29922993 // 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