@@ -468,8 +468,7 @@ macro_rules! define_maps {
468
468
469
469
define_provider_struct! {
470
470
tcx: $tcx,
471
- input: ( $( ( [ $( $modifiers) * ] [ $name] [ $K] [ $V] ) ) * ) ,
472
- output: ( )
471
+ input: ( $( ( [ $( $modifiers) * ] [ $name] [ $K] [ $V] ) ) * )
473
472
}
474
473
475
474
impl <$tcx> Copy for Providers <$tcx> { }
@@ -480,78 +479,19 @@ macro_rules! define_maps {
480
479
}
481
480
482
481
macro_rules! define_map_struct {
483
- // Initial state
484
482
( tcx: $tcx: tt,
485
- input: $input: tt) => {
486
- define_map_struct! {
487
- tcx: $tcx,
488
- input: $input,
489
- output: ( )
490
- }
491
- } ;
492
-
493
- // Final output
494
- ( tcx: $tcx: tt,
495
- input: ( ) ,
496
- output: ( $( $output: tt) * ) ) => {
483
+ input: ( $( ( [ $( modifiers: tt) * ] [ $( $attr: tt) * ] [ $name: ident] ) ) * ) ) => {
497
484
pub struct Maps <$tcx> {
498
485
providers: IndexVec <CrateNum , Providers <$tcx>>,
499
486
query_stack: RefCell <Vec <( Span , Query <$tcx>) >>,
500
- $( $output) *
501
- }
502
- } ;
503
-
504
- // Field recognized and ready to shift into the output
505
- ( tcx: $tcx: tt,
506
- ready: ( [ $( $pub: tt) * ] [ $( $attr: tt) * ] [ $name: ident] ) ,
507
- input: $input: tt,
508
- output: ( $( $output: tt) * ) ) => {
509
- define_map_struct! {
510
- tcx: $tcx,
511
- input: $input,
512
- output: ( $( $output) *
513
- $( #[ $attr] ) * $( $pub) * $name: RefCell <QueryMap <queries:: $name<$tcx>>>, )
514
- }
515
- } ;
516
-
517
- // No modifiers left? This is a private item.
518
- ( tcx: $tcx: tt,
519
- input: ( ( [ ] $attrs: tt $name: tt) $( $input: tt) * ) ,
520
- output: $output: tt) => {
521
- define_map_struct! {
522
- tcx: $tcx,
523
- ready: ( [ ] $attrs $name) ,
524
- input: ( $( $input) * ) ,
525
- output: $output
526
- }
527
- } ;
528
-
529
- // Skip other modifiers
530
- ( tcx: $tcx: tt,
531
- input: ( ( [ $other_modifier: tt $( $modifiers: tt) * ] $( $fields: tt) * ) $( $input: tt) * ) ,
532
- output: $output: tt) => {
533
- define_map_struct! {
534
- tcx: $tcx,
535
- input: ( ( [ $( $modifiers) * ] $( $fields) * ) $( $input) * ) ,
536
- output: $output
487
+ $( $( #[ $attr] ) * $name: RefCell <QueryMap <queries:: $name<$tcx>>>, ) *
537
488
}
538
489
} ;
539
490
}
540
491
541
492
macro_rules! define_provider_struct {
542
- // Initial state:
543
- ( tcx: $tcx: tt, input: $input: tt) => {
544
- define_provider_struct! {
545
- tcx: $tcx,
546
- input: $input,
547
- output: ( )
548
- }
549
- } ;
550
-
551
- // Final state:
552
493
( tcx: $tcx: tt,
553
- input: ( ) ,
554
- output: ( $( ( [ $name: ident] [ $K: ty] [ $R: ty] ) ) * ) ) => {
494
+ input: ( $( ( [ $( $modifiers: tt) * ] [ $name: ident] [ $K: ty] [ $R: ty] ) ) * ) ) => {
555
495
pub struct Providers <$tcx> {
556
496
$( pub $name: for <' a> fn ( TyCtxt <' a, $tcx, $tcx>, $K) -> $R, ) *
557
497
}
@@ -566,41 +506,6 @@ macro_rules! define_provider_struct {
566
506
}
567
507
}
568
508
} ;
569
-
570
- // Something ready to shift:
571
- ( tcx: $tcx: tt,
572
- ready: ( $name: tt $K: tt $V: tt) ,
573
- input: $input: tt,
574
- output: ( $( $output: tt) * ) ) => {
575
- define_provider_struct! {
576
- tcx: $tcx,
577
- input: $input,
578
- output: ( $( $output) * ( $name $K $V) )
579
- }
580
- } ;
581
-
582
- // Regular queries produce a `V` only.
583
- ( tcx: $tcx: tt,
584
- input: ( ( [ ] $name: tt $K: tt $V: tt) $( $input: tt) * ) ,
585
- output: $output: tt) => {
586
- define_provider_struct! {
587
- tcx: $tcx,
588
- ready: ( $name $K $V) ,
589
- input: ( $( $input) * ) ,
590
- output: $output
591
- }
592
- } ;
593
-
594
- // Skip modifiers.
595
- ( tcx: $tcx: tt,
596
- input: ( ( [ $other_modifier: tt $( $modifiers: tt) * ] $( $fields: tt) * ) $( $input: tt) * ) ,
597
- output: $output: tt) => {
598
- define_provider_struct! {
599
- tcx: $tcx,
600
- input: ( ( [ $( $modifiers) * ] $( $fields) * ) $( $input) * ) ,
601
- output: $output
602
- }
603
- } ;
604
509
}
605
510
606
511
0 commit comments