@@ -853,35 +853,31 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
853853 module : CachedModuleCodegen ,
854854 module_config : & ModuleConfig ,
855855) -> WorkItemResult < B > {
856+ assert ! ( module_config. emit_obj != EmitObj :: None ) ;
857+
856858 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+ ) ) ;
877875 }
878876
879- assert_eq ! ( object. is_some( ) , module_config. emit_obj != EmitObj :: None ) ;
880-
881877 WorkItemResult :: Compiled ( CompiledModule {
882878 name : module. name ,
883879 kind : ModuleKind :: Regular ,
884- object,
880+ object : Some ( obj_out ) ,
885881 dwarf_object : None ,
886882 bytecode : None ,
887883 } )
0 commit comments