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 {
2958
2958
}
2959
2959
2960
2960
impl ProcRes {
2961
- pub fn print_info ( & self ) {
2961
+ #[ must_use]
2962
+ pub fn format_info ( & self ) -> String {
2962
2963
fn render ( name : & str , contents : & str ) -> String {
2963
2964
let contents = json:: extract_rendered ( contents) ;
2964
2965
let contents = contents. trim_end ( ) ;
@@ -2974,20 +2975,20 @@ impl ProcRes {
2974
2975
}
2975
2976
}
2976
2977
2977
- println ! (
2978
+ format ! (
2978
2979
"status: {}\n command: {}\n {}\n {}\n " ,
2979
2980
self . status,
2980
2981
self . cmdline,
2981
2982
render( "stdout" , & self . stdout) ,
2982
2983
render( "stderr" , & self . stderr) ,
2983
- ) ;
2984
+ )
2984
2985
}
2985
2986
2986
2987
pub fn fatal ( & self , err : Option < & str > , on_failure : impl FnOnce ( ) ) -> ! {
2987
2988
if let Some ( e) = err {
2988
2989
println ! ( "\n error: {}" , e) ;
2989
2990
}
2990
- self . print_info ( ) ;
2991
+ println ! ( "{}" , self . format_info ( ) ) ;
2991
2992
on_failure ( ) ;
2992
2993
// Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
2993
2994
// 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