@@ -154,7 +154,7 @@ pub trait ParallelSystemDescriptorCoercion<Params> {
154154
155155 /// Specifies that the system is exempt from execution order ambiguity detection
156156 /// with other systems with the given label.
157- fn ambiguous_with ( self , label : impl SystemLabel ) -> ParallelSystemDescriptor ;
157+ fn ambiguous_with < Marker > ( self , label : impl AsSystemLabel < Marker > ) -> ParallelSystemDescriptor ;
158158}
159159
160160impl ParallelSystemDescriptorCoercion < ( ) > for ParallelSystemDescriptor {
@@ -186,14 +186,20 @@ impl ParallelSystemDescriptorCoercion<()> for ParallelSystemDescriptor {
186186 self
187187 }
188188
189- fn ambiguous_with ( mut self , label : impl SystemLabel ) -> ParallelSystemDescriptor {
189+ fn ambiguous_with < Marker > (
190+ mut self ,
191+ label : impl AsSystemLabel < Marker > ,
192+ ) -> ParallelSystemDescriptor {
193+ let system_label = label. as_system_label ( ) ;
194+ let boxed_system_label: Box < dyn SystemLabel > = Box :: new ( system_label) ;
195+
190196 match & mut self . ambiguity_detection {
191197 AmbiguityDetection :: IgnoreWithLabel ( v) => {
192- v. push ( Box :: new ( label ) ) ;
198+ v. push ( boxed_system_label ) ;
193199 }
194200 _ => {
195201 self . ambiguity_detection =
196- AmbiguityDetection :: IgnoreWithLabel ( vec ! [ Box :: new ( label ) ] ) ;
202+ AmbiguityDetection :: IgnoreWithLabel ( vec ! [ boxed_system_label ] ) ;
197203 }
198204 }
199205 self
@@ -228,7 +234,7 @@ where
228234 new_parallel_descriptor ( Box :: new ( IntoSystem :: into_system ( self ) ) ) . ignore_all_ambiguities ( )
229235 }
230236
231- fn ambiguous_with ( self , label : impl SystemLabel ) -> ParallelSystemDescriptor {
237+ fn ambiguous_with < Marker > ( self , label : impl AsSystemLabel < Marker > ) -> ParallelSystemDescriptor {
232238 new_parallel_descriptor ( Box :: new ( IntoSystem :: into_system ( self ) ) ) . ambiguous_with ( label)
233239 }
234240}
@@ -257,7 +263,7 @@ impl ParallelSystemDescriptorCoercion<()> for BoxedSystem<(), ()> {
257263 new_parallel_descriptor ( self ) . ignore_all_ambiguities ( )
258264 }
259265
260- fn ambiguous_with ( self , label : impl SystemLabel ) -> ParallelSystemDescriptor {
266+ fn ambiguous_with < Marker > ( self , label : impl AsSystemLabel < Marker > ) -> ParallelSystemDescriptor {
261267 new_parallel_descriptor ( self ) . ambiguous_with ( label)
262268 }
263269}
@@ -324,7 +330,8 @@ pub trait ExclusiveSystemDescriptorCoercion {
324330
325331 /// Specifies that the system is exempt from execution order ambiguity detection
326332 /// with other systems with the given label.
327- fn ambiguous_with ( self , label : impl SystemLabel ) -> ExclusiveSystemDescriptor ;
333+ fn ambiguous_with < Marker > ( self , label : impl AsSystemLabel < Marker > )
334+ -> ExclusiveSystemDescriptor ;
328335}
329336
330337impl ExclusiveSystemDescriptorCoercion for ExclusiveSystemDescriptor {
@@ -371,14 +378,20 @@ impl ExclusiveSystemDescriptorCoercion for ExclusiveSystemDescriptor {
371378 self
372379 }
373380
374- fn ambiguous_with ( mut self , label : impl SystemLabel ) -> ExclusiveSystemDescriptor {
381+ fn ambiguous_with < Marker > (
382+ mut self ,
383+ label : impl AsSystemLabel < Marker > ,
384+ ) -> ExclusiveSystemDescriptor {
385+ let system_label = label. as_system_label ( ) ;
386+ let boxed_system_label: Box < dyn SystemLabel > = Box :: new ( system_label) ;
387+
375388 match & mut self . ambiguity_detection {
376389 AmbiguityDetection :: IgnoreWithLabel ( v) => {
377- v. push ( Box :: new ( label ) ) ;
390+ v. push ( boxed_system_label ) ;
378391 }
379392 _ => {
380393 self . ambiguity_detection =
381- AmbiguityDetection :: IgnoreWithLabel ( vec ! [ Box :: new ( label ) ] ) ;
394+ AmbiguityDetection :: IgnoreWithLabel ( vec ! [ boxed_system_label ] ) ;
382395 }
383396 }
384397 self
@@ -424,7 +437,10 @@ where
424437 new_exclusive_descriptor ( Box :: new ( self ) ) . silence_ambiguity_checks ( )
425438 }
426439
427- fn ambiguous_with ( self , label : impl SystemLabel ) -> ExclusiveSystemDescriptor {
440+ fn ambiguous_with < Marker > (
441+ self ,
442+ label : impl AsSystemLabel < Marker > ,
443+ ) -> ExclusiveSystemDescriptor {
428444 new_exclusive_descriptor ( Box :: new ( self ) ) . ambiguous_with ( label)
429445 }
430446}
0 commit comments