@@ -22,6 +22,7 @@ pub mod util;
2222use core:: panic;
2323use std:: collections:: HashSet ;
2424use std:: ffi:: OsString ;
25+ use std:: fmt:: Write ;
2526use std:: io:: { self , ErrorKind } ;
2627use std:: path:: { Path , PathBuf } ;
2728use std:: process:: { Command , Stdio } ;
@@ -570,18 +571,22 @@ pub fn run_tests(config: Arc<Config>) {
570571 // easy to miss which tests failed, and as such fail to reproduce
571572 // the failure locally.
572573
573- println ! (
574- "Some tests failed in compiletest suite={}{} mode={} host={} target={}" ,
575- config. suite,
576- config
577- . compare_mode
578- . as_ref( )
579- . map( |c| format!( " compare_mode={:?}" , c) )
580- . unwrap_or_default( ) ,
581- config. mode,
582- config. host,
583- config. target
584- ) ;
574+ let mut msg = String :: from ( "Some tests failed in compiletest" ) ;
575+ write ! ( msg, " suite={}" , config. suite) . unwrap ( ) ;
576+
577+ if let Some ( compare_mode) = config. compare_mode . as_ref ( ) {
578+ write ! ( msg, " compare_mode={}" , compare_mode) . unwrap ( ) ;
579+ }
580+
581+ if let Some ( pass_mode) = config. force_pass_mode . as_ref ( ) {
582+ write ! ( msg, " pass_mode={}" , pass_mode) . unwrap ( ) ;
583+ }
584+
585+ write ! ( msg, " mode={}" , config. mode) . unwrap ( ) ;
586+ write ! ( msg, " host={}" , config. host) . unwrap ( ) ;
587+ write ! ( msg, " target={}" , config. target) . unwrap ( ) ;
588+
589+ println ! ( "{msg}" ) ;
585590
586591 std:: process:: exit ( 1 ) ;
587592 }
0 commit comments