@@ -853,35 +853,31 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
853
853
module : CachedModuleCodegen ,
854
854
module_config : & ModuleConfig ,
855
855
) -> WorkItemResult < B > {
856
+ assert ! ( module_config. emit_obj != EmitObj :: None ) ;
857
+
856
858
let incr_comp_session_dir = cgcx. incr_comp_session_dir . as_ref ( ) . unwrap ( ) ;
857
- let mut object = None ;
858
- if let Some ( saved_file) = module. source . saved_file {
859
- let obj_out = cgcx. output_filenames . temp_path ( OutputType :: Object , Some ( & module. name ) ) ;
860
- object = Some ( obj_out. clone ( ) ) ;
861
- let source_file = in_incr_comp_dir ( & incr_comp_session_dir, & saved_file) ;
862
- debug ! (
863
- "copying pre-existing module `{}` from {:?} to {}" ,
864
- module. name,
865
- source_file,
866
- obj_out. display( )
867
- ) ;
868
- if let Err ( err) = link_or_copy ( & source_file, & obj_out) {
869
- let diag_handler = cgcx. create_diag_handler ( ) ;
870
- diag_handler. err ( & format ! (
871
- "unable to copy {} to {}: {}" ,
872
- source_file. display( ) ,
873
- obj_out. display( ) ,
874
- err
875
- ) ) ;
876
- }
859
+ let obj_out = cgcx. output_filenames . temp_path ( OutputType :: Object , Some ( & module. name ) ) ;
860
+ let source_file = in_incr_comp_dir ( & incr_comp_session_dir, & module. source . saved_file ) ;
861
+ debug ! (
862
+ "copying pre-existing module `{}` from {:?} to {}" ,
863
+ module. name,
864
+ source_file,
865
+ obj_out. display( )
866
+ ) ;
867
+ if let Err ( err) = link_or_copy ( & source_file, & obj_out) {
868
+ let diag_handler = cgcx. create_diag_handler ( ) ;
869
+ diag_handler. err ( & format ! (
870
+ "unable to copy {} to {}: {}" ,
871
+ source_file. display( ) ,
872
+ obj_out. display( ) ,
873
+ err
874
+ ) ) ;
877
875
}
878
876
879
- assert_eq ! ( object. is_some( ) , module_config. emit_obj != EmitObj :: None ) ;
880
-
881
877
WorkItemResult :: Compiled ( CompiledModule {
882
878
name : module. name ,
883
879
kind : ModuleKind :: Regular ,
884
- object,
880
+ object : Some ( obj_out ) ,
885
881
dwarf_object : None ,
886
882
bytecode : None ,
887
883
} )
0 commit comments