@@ -46,11 +46,10 @@ pub fn remove(sess: &Session, path: &Path) {
4646/// Performs the linkage portion of the compilation phase. This will generate all
4747/// of the requested outputs for this compilation session.
4848pub fn link_binary < ' a , B : ArchiveBuilder < ' a > > ( sess : & ' a Session ,
49- codegen_results : & CodegenResults ,
50- outputs : & OutputFilenames ,
51- crate_name : & str ,
52- target_cpu : & str ) -> Vec < PathBuf > {
53- let mut out_filenames = Vec :: new ( ) ;
49+ codegen_results : & CodegenResults ,
50+ outputs : & OutputFilenames ,
51+ crate_name : & str ,
52+ target_cpu : & str ) {
5453 for & crate_type in sess. crate_types . borrow ( ) . iter ( ) {
5554 // Ignore executable crates if we have -Z no-codegen, as they will error.
5655 let output_metadata = sess. opts . output_types . contains_key ( & OutputType :: Metadata ) ;
@@ -64,13 +63,12 @@ pub fn link_binary<'a, B: ArchiveBuilder<'a>>(sess: &'a Session,
6463 bug ! ( "invalid output type `{:?}` for target os `{}`" ,
6564 crate_type, sess. opts. target_triple) ;
6665 }
67- let out_files = link_binary_output :: < B > ( sess,
68- codegen_results,
69- crate_type,
70- outputs,
71- crate_name,
72- target_cpu) ;
73- out_filenames. extend ( out_files) ;
66+ link_binary_output :: < B > ( sess,
67+ codegen_results,
68+ crate_type,
69+ outputs,
70+ crate_name,
71+ target_cpu) ;
7472 }
7573
7674 // Remove the temporary object file and metadata if we aren't saving temps
@@ -97,22 +95,18 @@ pub fn link_binary<'a, B: ArchiveBuilder<'a>>(sess: &'a Session,
9795 }
9896 }
9997 }
100-
101- out_filenames
10298}
10399
104100fn link_binary_output < ' a , B : ArchiveBuilder < ' a > > ( sess : & ' a Session ,
105- codegen_results : & CodegenResults ,
106- crate_type : config:: CrateType ,
107- outputs : & OutputFilenames ,
108- crate_name : & str ,
109- target_cpu : & str ) -> Vec < PathBuf > {
101+ codegen_results : & CodegenResults ,
102+ crate_type : config:: CrateType ,
103+ outputs : & OutputFilenames ,
104+ crate_name : & str ,
105+ target_cpu : & str ) {
110106 for obj in codegen_results. modules . iter ( ) . filter_map ( |m| m. object . as_ref ( ) ) {
111107 check_file_is_writeable ( obj, sess) ;
112108 }
113109
114- let mut out_filenames = vec ! [ ] ;
115-
116110 if outputs. outputs . contains_key ( & OutputType :: Metadata ) {
117111 let out_filename = filename_for_metadata ( sess, crate_name, outputs) ;
118112 // To avoid races with another rustc process scanning the output directory,
@@ -128,7 +122,6 @@ fn link_binary_output<'a, B: ArchiveBuilder<'a>>(sess: &'a Session,
128122 if let Err ( e) = fs:: rename ( metadata, & out_filename) {
129123 sess. fatal ( & format ! ( "failed to write {}: {}" , out_filename. display( ) , e) ) ;
130124 }
131- out_filenames. push ( out_filename) ;
132125 }
133126
134127 let tmpdir = TempFileBuilder :: new ( ) . prefix ( "rustc" ) . tempdir ( ) . unwrap_or_else ( |err|
@@ -158,14 +151,11 @@ fn link_binary_output<'a, B: ArchiveBuilder<'a>>(sess: &'a Session,
158151 ) ;
159152 }
160153 }
161- out_filenames. push ( out_filename) ;
162154 }
163155
164156 if sess. opts . cg . save_temps {
165157 let _ = tmpdir. into_path ( ) ;
166158 }
167-
168- out_filenames
169159}
170160
171161// The third parameter is for env vars, used on windows to set up the
0 commit comments