@@ -605,7 +605,7 @@ impl dyn TestStatus {
605
605
let ( cmd, output) = run_command ( cmd) ?;
606
606
607
607
let mode = comments. mode ( revision) ?;
608
- let cmd = check_test_result (
608
+ let ( cmd, output ) = check_test_result (
609
609
cmd,
610
610
match * mode {
611
611
Mode :: Run { .. } => Mode :: Pass ,
@@ -615,16 +615,14 @@ impl dyn TestStatus {
615
615
& config,
616
616
revision,
617
617
comments,
618
- & output,
618
+ output,
619
619
) ?;
620
620
621
621
if let Mode :: Run { .. } = * mode {
622
622
return run_test_binary ( mode, path, revision, comments, cmd, & config) ;
623
623
}
624
624
625
- run_rustfix (
626
- & output, path, comments, revision, & config, * mode, extra_args,
627
- ) ?;
625
+ run_rustfix ( output, path, comments, revision, & config, * mode, extra_args) ?;
628
626
Ok ( TestOk :: Ok )
629
627
}
630
628
}
@@ -758,7 +756,7 @@ fn run_test_binary(
758
756
}
759
757
760
758
fn run_rustfix (
761
- output : & Output ,
759
+ output : Output ,
762
760
path : & Path ,
763
761
comments : & Comments ,
764
762
revision : & str ,
@@ -821,8 +819,8 @@ fn run_rustfix(
821
819
. map_err ( |err| Errored {
822
820
command : Command :: new ( format ! ( "rustfix {}" , path. display( ) ) ) ,
823
821
errors : vec ! [ Error :: Rustfix ( err) ] ,
824
- stderr : output. stderr . clone ( ) ,
825
- stdout : output. stdout . clone ( ) ,
822
+ stderr : output. stderr ,
823
+ stdout : output. stdout ,
826
824
} ) ?;
827
825
828
826
let edition = comments. edition ( revision) ?. into ( ) ;
@@ -929,23 +927,19 @@ fn check_test_result(
929
927
config : & Config ,
930
928
revision : & str ,
931
929
comments : & Comments ,
932
- Output {
933
- status,
934
- stdout,
935
- stderr,
936
- } : & Output ,
937
- ) -> Result < Command , Errored > {
930
+ output : Output ,
931
+ ) -> Result < ( Command , Output ) , Errored > {
938
932
let mut errors = vec ! [ ] ;
939
- errors. extend ( mode. ok ( * status) . err ( ) ) ;
933
+ errors. extend ( mode. ok ( output . status ) . err ( ) ) ;
940
934
// Always remove annotation comments from stderr.
941
- let diagnostics = rustc_stderr:: process ( path, stderr) ;
935
+ let diagnostics = rustc_stderr:: process ( path, & output . stderr ) ;
942
936
check_test_output (
943
937
path,
944
938
& mut errors,
945
939
revision,
946
940
config,
947
941
comments,
948
- stdout,
942
+ & output . stdout ,
949
943
& diagnostics. rendered ,
950
944
) ;
951
945
// Check error annotations in the source against output
@@ -958,13 +952,13 @@ fn check_test_result(
958
952
comments,
959
953
) ?;
960
954
if errors. is_empty ( ) {
961
- Ok ( command)
955
+ Ok ( ( command, output ) )
962
956
} else {
963
957
Err ( Errored {
964
958
command,
965
959
errors,
966
960
stderr : diagnostics. rendered ,
967
- stdout : stdout . clone ( ) ,
961
+ stdout : output . stdout ,
968
962
} )
969
963
}
970
964
}
0 commit comments