@@ -536,35 +536,16 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
536
536
537
537
let write_deps_to_file = |file : & mut dyn Write | -> io:: Result < ( ) > {
538
538
for path in out_filenames {
539
- write ! (
539
+ writeln ! (
540
540
file,
541
- "{}: {}" ,
541
+ "{}: {}\n " ,
542
542
path. display( ) ,
543
543
files
544
544
. iter( )
545
545
. map( |( path, _file_len, _checksum_hash_algo) | path. as_str( ) )
546
546
. intersperse( " " )
547
547
. collect:: <String >( )
548
548
) ?;
549
-
550
- // If caller requested this information, add special comments about source file checksums.
551
- // These are not necessarily the same checksums as was used in the debug files.
552
- if sess. opts . unstable_opts . checksum_hash_algorithm ( ) . is_some ( ) {
553
- assert ! (
554
- files. iter( ) . all( |( _path, _file_len, hash_algo) | hash_algo. is_some( ) ) ,
555
- "all files must have a checksum hash computed to output checksum hashes"
556
- ) ;
557
- write ! ( file, " #" ) ?;
558
- files
559
- . iter ( )
560
- . filter_map ( |( _path, file_len, hash_algo) | {
561
- hash_algo. map ( |hash_algo| ( path, file_len, hash_algo) )
562
- } )
563
- . try_for_each ( |( _path, file_len, checksum_hash) | {
564
- write ! ( file, " checksum:{checksum_hash} file_len:{file_len}" )
565
- } ) ?;
566
- }
567
- write ! ( file, "\n \n " ) ?;
568
549
}
569
550
570
551
// Emit a fake target for each input file to the compilation. This
@@ -594,6 +575,18 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
594
575
}
595
576
}
596
577
578
+ // If caller requested this information, add special comments about source file checksums.
579
+ // These are not necessarily the same checksums as was used in the debug files.
580
+ if sess. opts . unstable_opts . checksum_hash_algorithm ( ) . is_some ( ) {
581
+ for ( path, file_len, checksum_hash) in
582
+ files. iter ( ) . filter_map ( |( path, file_len, hash_algo) | {
583
+ hash_algo. map ( |hash_algo| ( path, file_len, hash_algo) )
584
+ } )
585
+ {
586
+ writeln ! ( file, "# checksum:{checksum_hash} file_len:{file_len} {path}" ) ?;
587
+ }
588
+ }
589
+
597
590
Ok ( ( ) )
598
591
} ;
599
592
0 commit comments