@@ -392,8 +392,8 @@ struct AdapterShared {
392392 presentation_timer : time:: PresentationTimer ,
393393}
394394
395- unsafe impl Send for AdapterShared { }
396- unsafe impl Sync for AdapterShared { }
395+ # [ cfg ( send_sync ) ]
396+ static_assertions :: assert_impl_all! ( AdapterShared : Send , Sync ) ;
397397
398398impl AdapterShared {
399399 fn new (
@@ -446,13 +446,16 @@ pub struct Adapter {
446446 shared : Arc < AdapterShared > ,
447447}
448448
449+ #[ cfg( send_sync) ]
450+ static_assertions:: assert_impl_all!( Adapter : Send , Sync ) ;
451+
449452pub struct Queue {
450453 shared : Arc < QueueShared > ,
451454 timestamp_period : f32 ,
452455}
453456
454- unsafe impl Send for Queue { }
455- unsafe impl Sync for Queue { }
457+ # [ cfg ( send_sync ) ]
458+ static_assertions :: assert_impl_all! ( Queue : Send , Sync ) ;
456459
457460impl Queue {
458461 pub unsafe fn queue_from_raw (
@@ -703,8 +706,8 @@ pub struct Sampler {
703706
704707impl crate :: DynSampler for Sampler { }
705708
706- unsafe impl Send for Sampler { }
707- unsafe impl Sync for Sampler { }
709+ # [ cfg ( send_sync ) ]
710+ static_assertions :: assert_impl_all! ( Sampler : Send , Sync ) ;
708711
709712impl Sampler {
710713 fn as_raw ( & self ) -> NonNull < ProtocolObject < dyn MTLSamplerState > > {
@@ -887,8 +890,8 @@ pub struct PassthroughShader {
887890 pub num_workgroups : HashMap < String , ( u32 , u32 , u32 ) > ,
888891}
889892
890- unsafe impl Send for PassthroughShader { }
891- unsafe impl Sync for PassthroughShader { }
893+ # [ cfg ( send_sync ) ]
894+ static_assertions :: assert_impl_all! ( PassthroughShader : Send , Sync ) ;
892895
893896#[ derive( Debug ) ]
894897pub struct ShaderModule {
@@ -993,8 +996,8 @@ pub struct RenderPipeline {
993996 ) > ,
994997}
995998
996- unsafe impl Send for RenderPipeline { }
997- unsafe impl Sync for RenderPipeline { }
999+ # [ cfg ( send_sync ) ]
1000+ static_assertions :: assert_impl_all! ( RenderPipeline : Send , Sync ) ;
9981001
9991002impl crate :: DynRenderPipeline for RenderPipeline { }
10001003
@@ -1004,8 +1007,8 @@ pub struct ComputePipeline {
10041007 cs_info : PipelineStageInfo ,
10051008}
10061009
1007- unsafe impl Send for ComputePipeline { }
1008- unsafe impl Sync for ComputePipeline { }
1010+ # [ cfg ( send_sync ) ]
1011+ static_assertions :: assert_impl_all! ( ComputePipeline : Send , Sync ) ;
10091012
10101013impl crate :: DynComputePipeline for ComputePipeline { }
10111014
0 commit comments