File tree 1 file changed +10
-15
lines changed
1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -80,29 +80,24 @@ fn reuse_workproduct_for_cgu(
80
80
cgu : & CodegenUnit < ' _ > ,
81
81
work_products : & mut FxHashMap < WorkProductId , WorkProduct > ,
82
82
) -> CompiledModule {
83
- let mut object = None ;
84
83
let work_product = cgu. previous_work_product ( tcx) ;
85
- if let Some ( saved_file) = & work_product. saved_file {
86
- let obj_out =
87
- tcx. output_filenames ( ( ) ) . temp_path ( OutputType :: Object , Some ( cgu. name ( ) . as_str ( ) ) ) ;
88
- object = Some ( obj_out. clone ( ) ) ;
89
- let source_file = rustc_incremental:: in_incr_comp_dir_sess ( & tcx. sess , & saved_file) ;
90
- if let Err ( err) = rustc_fs_util:: link_or_copy ( & source_file, & obj_out) {
91
- tcx. sess . err ( & format ! (
92
- "unable to copy {} to {}: {}" ,
93
- source_file. display( ) ,
94
- obj_out. display( ) ,
95
- err
96
- ) ) ;
97
- }
84
+ let obj_out = tcx. output_filenames ( ( ) ) . temp_path ( OutputType :: Object , Some ( cgu. name ( ) . as_str ( ) ) ) ;
85
+ let source_file = rustc_incremental:: in_incr_comp_dir_sess ( & tcx. sess , & work_product. saved_file ) ;
86
+ if let Err ( err) = rustc_fs_util:: link_or_copy ( & source_file, & obj_out) {
87
+ tcx. sess . err ( & format ! (
88
+ "unable to copy {} to {}: {}" ,
89
+ source_file. display( ) ,
90
+ obj_out. display( ) ,
91
+ err
92
+ ) ) ;
98
93
}
99
94
100
95
work_products. insert ( cgu. work_product_id ( ) , work_product) ;
101
96
102
97
CompiledModule {
103
98
name : cgu. name ( ) . to_string ( ) ,
104
99
kind : ModuleKind :: Regular ,
105
- object,
100
+ object : Some ( obj_out ) ,
106
101
dwarf_object : None ,
107
102
bytecode : None ,
108
103
}
You can’t perform that action at this time.
0 commit comments