@@ -382,7 +382,7 @@ pub struct CompiledModules {
382382
383383fn need_bitcode_in_object ( sess : & Session ) -> bool {
384384 let requested_for_rlib = sess. opts . cg . embed_bitcode
385- && sess. crate_types . borrow ( ) . contains ( & CrateType :: Rlib )
385+ && sess. crate_types ( ) . contains ( & CrateType :: Rlib )
386386 && sess. opts . output_types . contains_key ( & OutputType :: Exe ) ;
387387 let forced_by_target = sess. target . target . options . forces_embed_bitcode ;
388388 requested_for_rlib || forced_by_target
@@ -991,7 +991,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
991991 } ;
992992 let cgcx = CodegenContext :: < B > {
993993 backend : backend. clone ( ) ,
994- crate_types : sess. crate_types . borrow ( ) . clone ( ) ,
994+ crate_types : sess. crate_types ( ) . to_vec ( ) ,
995995 each_linked_rlib_for_lto,
996996 lto : sess. lto ( ) ,
997997 no_landing_pads : sess. panic_strategy ( ) == PanicStrategy :: Abort ,
@@ -1812,7 +1812,7 @@ fn msvc_imps_needed(tcx: TyCtxt<'_>) -> bool {
18121812 ) ;
18131813
18141814 tcx. sess . target . target . options . is_like_msvc &&
1815- tcx. sess . crate_types . borrow ( ) . iter ( ) . any ( |ct| * ct == CrateType :: Rlib ) &&
1815+ tcx. sess . crate_types ( ) . iter ( ) . any ( |ct| * ct == CrateType :: Rlib ) &&
18161816 // ThinLTO can't handle this workaround in all cases, so we don't
18171817 // emit the `__imp_` symbols. Instead we make them unnecessary by disallowing
18181818 // dynamic linking when linker plugin LTO is enabled.
0 commit comments