@@ -212,13 +212,13 @@ impl ItemTree {
212
212
SmallModItem :: Trait ( _) => traits += 1 ,
213
213
SmallModItem :: Impl ( _) => impls += 1 ,
214
214
SmallModItem :: MacroRules ( _) => macro_rules += 1 ,
215
+ SmallModItem :: MacroCall ( _) => macro_calls += 1 ,
215
216
_ => { }
216
217
}
217
218
}
218
219
for item in self . big_data . values ( ) {
219
220
match item {
220
221
BigModItem :: Mod ( _) => mods += 1 ,
221
- BigModItem :: MacroCall ( _) => macro_calls += 1 ,
222
222
_ => { }
223
223
}
224
224
}
@@ -246,11 +246,14 @@ struct ItemVisibilities {
246
246
enum SmallModItem {
247
247
Const ( Const ) ,
248
248
Enum ( Enum ) ,
249
+ ExternBlock ( ExternBlock ) ,
249
250
Function ( Function ) ,
250
251
Impl ( Impl ) ,
251
252
Macro2 ( Macro2 ) ,
253
+ MacroCall ( MacroCall ) ,
252
254
MacroRules ( MacroRules ) ,
253
255
Static ( Static ) ,
256
+ Struct ( Struct ) ,
254
257
Trait ( Trait ) ,
255
258
TraitAlias ( TraitAlias ) ,
256
259
TypeAlias ( TypeAlias ) ,
@@ -259,11 +262,8 @@ enum SmallModItem {
259
262
260
263
#[ derive( Debug , Clone , Eq , PartialEq ) ]
261
264
enum BigModItem {
262
- ExternBlock ( ExternBlock ) ,
263
265
ExternCrate ( ExternCrate ) ,
264
- MacroCall ( MacroCall ) ,
265
266
Mod ( Mod ) ,
266
- Struct ( Struct ) ,
267
267
Use ( Use ) ,
268
268
}
269
269
@@ -370,23 +370,23 @@ macro_rules! mod_items {
370
370
371
371
mod_items ! {
372
372
ModItemId ->
373
- Use in big_data -> ast:: Use ,
373
+ Const in small_data -> ast:: Const ,
374
+ Enum in small_data -> ast:: Enum ,
375
+ ExternBlock in small_data -> ast:: ExternBlock ,
374
376
ExternCrate in big_data -> ast:: ExternCrate ,
375
- ExternBlock in big_data -> ast:: ExternBlock ,
376
377
Function in small_data -> ast:: Fn ,
377
- Struct in big_data -> ast:: Struct ,
378
- Union in small_data -> ast:: Union ,
379
- Enum in small_data -> ast:: Enum ,
380
- Const in small_data -> ast:: Const ,
378
+ Impl in small_data -> ast:: Impl ,
379
+ Macro2 in small_data -> ast:: MacroDef ,
380
+ MacroCall in small_data -> ast:: MacroCall ,
381
+ MacroRules in small_data -> ast:: MacroRules ,
382
+ Mod in big_data -> ast:: Module ,
381
383
Static in small_data -> ast:: Static ,
384
+ Struct in small_data -> ast:: Struct ,
382
385
Trait in small_data -> ast:: Trait ,
383
386
TraitAlias in small_data -> ast:: TraitAlias ,
384
- Impl in small_data -> ast:: Impl ,
385
387
TypeAlias in small_data -> ast:: TypeAlias ,
386
- Mod in big_data -> ast:: Module ,
387
- MacroCall in big_data -> ast:: MacroCall ,
388
- MacroRules in small_data -> ast:: MacroRules ,
389
- Macro2 in small_data -> ast:: MacroDef ,
388
+ Union in small_data -> ast:: Union ,
389
+ Use in big_data -> ast:: Use ,
390
390
}
391
391
392
392
impl Index < RawVisibilityId > for ItemTree {
@@ -425,7 +425,6 @@ impl Index<RawVisibilityId> for ItemTree {
425
425
#[ derive( Debug , Clone , Eq , PartialEq ) ]
426
426
pub struct Use {
427
427
pub ( crate ) visibility : RawVisibilityId ,
428
- pub ( crate ) ast_id : FileAstId < ast:: Use > ,
429
428
pub ( crate ) use_tree : UseTree ,
430
429
}
431
430
@@ -490,42 +489,36 @@ pub struct ExternCrate {
490
489
pub name : Name ,
491
490
pub alias : Option < ImportAlias > ,
492
491
pub ( crate ) visibility : RawVisibilityId ,
493
- pub ast_id : FileAstId < ast:: ExternCrate > ,
494
492
}
495
493
496
494
#[ derive( Debug , Clone , Eq , PartialEq ) ]
497
495
pub struct ExternBlock {
498
- pub ast_id : FileAstId < ast:: ExternBlock > ,
499
496
pub ( crate ) children : Box < [ ModItemId ] > ,
500
497
}
501
498
502
499
#[ derive( Debug , Clone , Eq , PartialEq ) ]
503
500
pub struct Function {
504
501
pub name : Name ,
505
502
pub ( crate ) visibility : RawVisibilityId ,
506
- pub ast_id : FileAstId < ast:: Fn > ,
507
503
}
508
504
509
505
#[ derive( Debug , Clone , Eq , PartialEq ) ]
510
506
pub struct Struct {
511
507
pub name : Name ,
512
508
pub ( crate ) visibility : RawVisibilityId ,
513
509
pub shape : FieldsShape ,
514
- pub ast_id : FileAstId < ast:: Struct > ,
515
510
}
516
511
517
512
#[ derive( Debug , Clone , Eq , PartialEq ) ]
518
513
pub struct Union {
519
514
pub name : Name ,
520
515
pub ( crate ) visibility : RawVisibilityId ,
521
- pub ast_id : FileAstId < ast:: Union > ,
522
516
}
523
517
524
518
#[ derive( Debug , Clone , Eq , PartialEq ) ]
525
519
pub struct Enum {
526
520
pub name : Name ,
527
521
pub ( crate ) visibility : RawVisibilityId ,
528
- pub ast_id : FileAstId < ast:: Enum > ,
529
522
}
530
523
531
524
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -564,48 +557,40 @@ pub struct Const {
564
557
/// `None` for `const _: () = ();`
565
558
pub name : Option < Name > ,
566
559
pub ( crate ) visibility : RawVisibilityId ,
567
- pub ast_id : FileAstId < ast:: Const > ,
568
560
}
569
561
570
562
#[ derive( Debug , Clone , Eq , PartialEq ) ]
571
563
pub struct Static {
572
564
pub name : Name ,
573
565
pub ( crate ) visibility : RawVisibilityId ,
574
- pub ast_id : FileAstId < ast:: Static > ,
575
566
}
576
567
577
568
#[ derive( Debug , Clone , Eq , PartialEq ) ]
578
569
pub struct Trait {
579
570
pub name : Name ,
580
571
pub ( crate ) visibility : RawVisibilityId ,
581
- pub ast_id : FileAstId < ast:: Trait > ,
582
572
}
583
573
584
574
#[ derive( Debug , Clone , Eq , PartialEq ) ]
585
575
pub struct TraitAlias {
586
576
pub name : Name ,
587
577
pub ( crate ) visibility : RawVisibilityId ,
588
- pub ast_id : FileAstId < ast:: TraitAlias > ,
589
578
}
590
579
591
580
#[ derive( Debug , Clone , Eq , PartialEq ) ]
592
- pub struct Impl {
593
- pub ast_id : FileAstId < ast:: Impl > ,
594
- }
581
+ pub struct Impl { }
595
582
596
583
#[ derive( Debug , Clone , PartialEq , Eq ) ]
597
584
pub struct TypeAlias {
598
585
pub name : Name ,
599
586
pub ( crate ) visibility : RawVisibilityId ,
600
- pub ast_id : FileAstId < ast:: TypeAlias > ,
601
587
}
602
588
603
589
#[ derive( Debug , Clone , Eq , PartialEq ) ]
604
590
pub struct Mod {
605
591
pub name : Name ,
606
592
pub ( crate ) visibility : RawVisibilityId ,
607
593
pub ( crate ) kind : ModKind ,
608
- pub ast_id : FileAstId < ast:: Module > ,
609
594
}
610
595
611
596
#[ derive( Debug , Clone , Eq , PartialEq ) ]
@@ -620,7 +605,6 @@ pub(crate) enum ModKind {
620
605
pub struct MacroCall {
621
606
/// Path to the called macro.
622
607
pub path : Interned < ModPath > ,
623
- pub ast_id : FileAstId < ast:: MacroCall > ,
624
608
pub expand_to : ExpandTo ,
625
609
pub ctxt : SyntaxContext ,
626
610
}
@@ -629,15 +613,13 @@ pub struct MacroCall {
629
613
pub struct MacroRules {
630
614
/// The name of the declared macro.
631
615
pub name : Name ,
632
- pub ast_id : FileAstId < ast:: MacroRules > ,
633
616
}
634
617
635
618
/// "Macros 2.0" macro definition.
636
619
#[ derive( Debug , Clone , Eq , PartialEq ) ]
637
620
pub struct Macro2 {
638
621
pub name : Name ,
639
622
pub ( crate ) visibility : RawVisibilityId ,
640
- pub ast_id : FileAstId < ast:: MacroDef > ,
641
623
}
642
624
643
625
#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
0 commit comments