@@ -382,7 +382,7 @@ pub struct CompiledModules {
382
382
383
383
fn need_bitcode_in_object ( sess : & Session ) -> bool {
384
384
let requested_for_rlib = sess. opts . cg . embed_bitcode
385
- && sess. crate_types . borrow ( ) . contains ( & CrateType :: Rlib )
385
+ && sess. crate_types ( ) . contains ( & CrateType :: Rlib )
386
386
&& sess. opts . output_types . contains_key ( & OutputType :: Exe ) ;
387
387
let forced_by_target = sess. target . target . options . forces_embed_bitcode ;
388
388
requested_for_rlib || forced_by_target
@@ -991,7 +991,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
991
991
} ;
992
992
let cgcx = CodegenContext :: < B > {
993
993
backend : backend. clone ( ) ,
994
- crate_types : sess. crate_types . borrow ( ) . clone ( ) ,
994
+ crate_types : sess. crate_types ( ) . to_vec ( ) ,
995
995
each_linked_rlib_for_lto,
996
996
lto : sess. lto ( ) ,
997
997
no_landing_pads : sess. panic_strategy ( ) == PanicStrategy :: Abort ,
@@ -1812,7 +1812,7 @@ fn msvc_imps_needed(tcx: TyCtxt<'_>) -> bool {
1812
1812
) ;
1813
1813
1814
1814
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 ) &&
1816
1816
// ThinLTO can't handle this workaround in all cases, so we don't
1817
1817
// emit the `__imp_` symbols. Instead we make them unnecessary by disallowing
1818
1818
// dynamic linking when linker plugin LTO is enabled.
0 commit comments