@@ -436,8 +436,13 @@ pub fn derive_world_query(input: TokenStream) -> TokenStream {
436
436
437
437
/// Generates an impl of the `SystemLabel` trait.
438
438
///
439
- /// This works only for unit structs, or enums with only unit variants.
440
- /// You may force a struct or variant to behave as if it were fieldless with `#[system_label(ignore_fields)]`.
439
+ /// For unit structs and enums with only unit variants, a cheap implementation can easily be created.
440
+ ///
441
+ /// More complex types must be boxed and identified by their hash
442
+ /// - opt in to this by annotating the entire item with `#[system_label(hash)]`.
443
+ ///
444
+ /// Alternatively, you may force a struct or variant to behave as if
445
+ /// it were fieldless with `#[system_label(ignore_fields)]`.
441
446
#[ proc_macro_derive( SystemLabel , attributes( system_label) ) ]
442
447
pub fn derive_system_label ( input : TokenStream ) -> TokenStream {
443
448
let input = parse_macro_input ! ( input as DeriveInput ) ;
@@ -454,8 +459,13 @@ pub fn derive_system_label(input: TokenStream) -> TokenStream {
454
459
455
460
/// Generates an impl of the `StageLabel` trait.
456
461
///
457
- /// This works only for unit structs, or enums with only unit variants.
458
- /// You may force a struct or variant to behave as if it were fieldless with `#[stage_label(ignore_fields)]`.
462
+ /// For unit structs and enums with only unit variants, a cheap implementation can easily be created.
463
+ ///
464
+ /// More complex types must be boxed and identified by their hash
465
+ /// - opt in to this by annotating the entire item with `#[stage_label(hash)]`.
466
+ ///
467
+ /// Alternatively, you may force a struct or variant to behave as if
468
+ /// it were fieldless with `#[stage_label(ignore_fields)]`.
459
469
#[ proc_macro_derive( StageLabel , attributes( stage_label) ) ]
460
470
pub fn derive_stage_label ( input : TokenStream ) -> TokenStream {
461
471
let input = parse_macro_input ! ( input as DeriveInput ) ;
@@ -470,8 +480,13 @@ pub fn derive_stage_label(input: TokenStream) -> TokenStream {
470
480
471
481
/// Generates an impl of the `AmbiguitySetLabel` trait.
472
482
///
473
- /// This works only for unit structs, or enums with only unit variants.
474
- /// You may force a struct or variant to behave as if it were fieldless with `#[ambiguity_set_label(ignore_fields)]`.
483
+ /// For unit structs and enums with only unit variants, a cheap implementation can easily be created.
484
+ ///
485
+ /// More complex types must be boxed and identified by their hash
486
+ /// - opt in to this by annotating the entire item with `#[ambiguity_set_label(hash)]`.
487
+ ///
488
+ /// Alternatively, you may force a struct or variant to behave as if
489
+ /// it were fieldless with `#[ambiguity_set_label(ignore_fields)]`.
475
490
#[ proc_macro_derive( AmbiguitySetLabel , attributes( ambiguity_set_label) ) ]
476
491
pub fn derive_ambiguity_set_label ( input : TokenStream ) -> TokenStream {
477
492
let input = parse_macro_input ! ( input as DeriveInput ) ;
@@ -490,8 +505,13 @@ pub fn derive_ambiguity_set_label(input: TokenStream) -> TokenStream {
490
505
491
506
/// Generates an impl of the `RunCriteriaLabel` trait.
492
507
///
493
- /// This works only for unit structs, or enums with only unit variants.
494
- /// You may force a struct or variant to behave as if it were fieldless with `#[run_criteria_label(ignore_fields)]`.
508
+ /// For unit structs and enums with only unit variants, a cheap implementation can easily be created.
509
+ ///
510
+ /// More complex types must be boxed and identified by their hash
511
+ /// - opt in to this by annotating the entire item with `#[run_criteria_label(hash)]`.
512
+ ///
513
+ /// Alternatively, you may force a struct or variant to behave as if
514
+ /// it were fieldless with `#[run_criteria_label(ignore_fields)]`.
495
515
#[ proc_macro_derive( RunCriteriaLabel , attributes( run_criteria_label) ) ]
496
516
pub fn derive_run_criteria_label ( input : TokenStream ) -> TokenStream {
497
517
let input = parse_macro_input ! ( input as DeriveInput ) ;
0 commit comments