1212 * TODO(antoyo): remove the patches.
1313 */
1414
15+ #![ cfg_attr( not( bootstrap) , allow( internal_features) ) ]
16+ #![ cfg_attr( not( bootstrap) , doc( rust_logo) ) ]
17+ #![ cfg_attr( not( bootstrap) , feature( rustdoc_internals) ) ]
1518#![ feature(
1619 rustc_private,
1720 decl_macro,
@@ -73,6 +76,7 @@ mod type_;
7376mod type_of;
7477
7578use std:: any:: Any ;
79+ use std:: fmt:: Debug ;
7680use std:: sync:: Arc ;
7781use std:: sync:: Mutex ;
7882#[ cfg( not( feature="master" ) ) ]
@@ -93,6 +97,7 @@ use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, ModuleConfig,
9397use rustc_codegen_ssa:: back:: lto:: { LtoModuleCodegen , SerializedModule , ThinModule } ;
9498use rustc_codegen_ssa:: target_features:: supported_target_features;
9599use rustc_data_structures:: fx:: FxIndexMap ;
100+ use rustc_data_structures:: sync:: IntoDynSyncSend ;
96101use rustc_codegen_ssa:: traits:: { CodegenBackend , ExtraBackendMethods , ThinBufferMethods , WriteBackendMethods } ;
97102use rustc_errors:: { DiagnosticMessage , ErrorGuaranteed , Handler , SubdiagnosticMessage } ;
98103use rustc_fluent_macro:: fluent_messages;
@@ -138,9 +143,15 @@ impl TargetInfo {
138143 }
139144}
140145
141- #[ derive( Clone , Debug ) ]
146+ #[ derive( Clone ) ]
142147pub struct LockedTargetInfo {
143- info : Arc < Mutex < TargetInfo > > ,
148+ info : Arc < Mutex < IntoDynSyncSend < TargetInfo > > > ,
149+ }
150+
151+ impl Debug for LockedTargetInfo {
152+ fn fmt ( & self , formatter : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
153+ self . info . lock ( ) . expect ( "lock" ) . fmt ( formatter)
154+ }
144155}
145156
146157impl LockedTargetInfo {
@@ -174,7 +185,7 @@ impl CodegenBackend for GccCodegenBackend {
174185 context. add_command_line_option ( & format ! ( "-march={}" , target_cpu) ) ;
175186 }
176187
177- * self . target_info . info . lock ( ) . expect ( "lock" ) = context. get_target_info ( ) ;
188+ * * self . target_info . info . lock ( ) . expect ( "lock" ) = context. get_target_info ( ) ;
178189 }
179190
180191 #[ cfg( feature="master" ) ]
@@ -341,12 +352,12 @@ pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
341352 let info = {
342353 // Check whether the target supports 128-bit integers.
343354 let context = Context :: default ( ) ;
344- Arc :: new ( Mutex :: new ( context. get_target_info ( ) ) )
355+ Arc :: new ( Mutex :: new ( IntoDynSyncSend ( context. get_target_info ( ) ) ) )
345356 } ;
346357 #[ cfg( not( feature="master" ) ) ]
347- let info = Arc :: new ( Mutex :: new ( TargetInfo {
358+ let info = Arc :: new ( Mutex :: new ( IntoDynSyncSend ( TargetInfo {
348359 supports_128bit_integers : AtomicBool :: new ( false ) ,
349- } ) ) ;
360+ } ) ) ) ;
350361
351362 Box :: new ( GccCodegenBackend {
352363 target_info : LockedTargetInfo { info } ,
0 commit comments