@@ -682,6 +682,20 @@ fn stamp(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> Path
682
682
output_base_dir ( config, testpaths, revision) . join ( "stamp" )
683
683
}
684
684
685
+ /// Walk the directory at `path` and collect timestamps of all files into `inputs`.
686
+ fn collect_timestamps ( path : & PathBuf , inputs : & mut Vec < FileTime > ) {
687
+ let mut entries = path. read_dir ( ) . unwrap ( ) . collect :: < Vec < _ > > ( ) ;
688
+ while let Some ( entry) = entries. pop ( ) {
689
+ let entry = entry. unwrap ( ) ;
690
+ let path = entry. path ( ) ;
691
+ if entry. metadata ( ) . unwrap ( ) . is_file ( ) {
692
+ inputs. push ( mtime ( & path) ) ;
693
+ } else {
694
+ entries. extend ( path. read_dir ( ) . unwrap ( ) ) ;
695
+ }
696
+ }
697
+ }
698
+
685
699
fn up_to_date (
686
700
config : & Config ,
687
701
testpaths : & TestPaths ,
@@ -725,16 +739,7 @@ fn up_to_date(
725
739
for pretty_printer_file in & pretty_printer_files {
726
740
inputs. push ( mtime ( & rust_src_dir. join ( pretty_printer_file) ) ) ;
727
741
}
728
- let mut entries = config. run_lib_path . read_dir ( ) . unwrap ( ) . collect :: < Vec < _ > > ( ) ;
729
- while let Some ( entry) = entries. pop ( ) {
730
- let entry = entry. unwrap ( ) ;
731
- let path = entry. path ( ) ;
732
- if entry. metadata ( ) . unwrap ( ) . is_file ( ) {
733
- inputs. push ( mtime ( & path) ) ;
734
- } else {
735
- entries. extend ( path. read_dir ( ) . unwrap ( ) ) ;
736
- }
737
- }
742
+ collect_timestamps ( & config. run_lib_path , & mut inputs) ;
738
743
if let Some ( ref rustdoc_path) = config. rustdoc_path {
739
744
inputs. push ( mtime ( & rustdoc_path) ) ;
740
745
inputs. push ( mtime ( & rust_src_dir. join ( "src/etc/htmldocck.py" ) ) ) ;
@@ -746,6 +751,9 @@ fn up_to_date(
746
751
inputs. push ( mtime ( path) ) ;
747
752
}
748
753
754
+ // Compiletest itself.
755
+ collect_timestamps ( & rust_src_dir. join ( "src/tools/compiletest/" ) , & mut inputs) ;
756
+
749
757
inputs. iter ( ) . any ( |input| * input > stamp)
750
758
}
751
759
0 commit comments