@@ -536,35 +536,16 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
536536
537537 let write_deps_to_file = |file : & mut dyn Write | -> io:: Result < ( ) > {
538538 for path in out_filenames {
539- write ! (
539+ writeln ! (
540540 file,
541- "{}: {}" ,
541+ "{}: {}\n " ,
542542 path. display( ) ,
543543 files
544544 . iter( )
545545 . map( |( path, _file_len, _checksum_hash_algo) | path. as_str( ) )
546546 . intersperse( " " )
547547 . collect:: <String >( )
548548 ) ?;
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 " ) ?;
568549 }
569550
570551 // 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
594575 }
595576 }
596577
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+
597590 Ok ( ( ) )
598591 } ;
599592
0 commit comments