@@ -212,13 +212,13 @@ impl ItemTree {
212212 SmallModItem :: Trait ( _) => traits += 1 ,
213213 SmallModItem :: Impl ( _) => impls += 1 ,
214214 SmallModItem :: MacroRules ( _) => macro_rules += 1 ,
215+ SmallModItem :: MacroCall ( _) => macro_calls += 1 ,
215216 _ => { }
216217 }
217218 }
218219 for item in self . big_data . values ( ) {
219220 match item {
220221 BigModItem :: Mod ( _) => mods += 1 ,
221- BigModItem :: MacroCall ( _) => macro_calls += 1 ,
222222 _ => { }
223223 }
224224 }
@@ -246,11 +246,14 @@ struct ItemVisibilities {
246246enum SmallModItem {
247247 Const ( Const ) ,
248248 Enum ( Enum ) ,
249+ ExternBlock ( ExternBlock ) ,
249250 Function ( Function ) ,
250251 Impl ( Impl ) ,
251252 Macro2 ( Macro2 ) ,
253+ MacroCall ( MacroCall ) ,
252254 MacroRules ( MacroRules ) ,
253255 Static ( Static ) ,
256+ Struct ( Struct ) ,
254257 Trait ( Trait ) ,
255258 TraitAlias ( TraitAlias ) ,
256259 TypeAlias ( TypeAlias ) ,
@@ -259,11 +262,8 @@ enum SmallModItem {
259262
260263#[ derive( Debug , Clone , Eq , PartialEq ) ]
261264enum BigModItem {
262- ExternBlock ( ExternBlock ) ,
263265 ExternCrate ( ExternCrate ) ,
264- MacroCall ( MacroCall ) ,
265266 Mod ( Mod ) ,
266- Struct ( Struct ) ,
267267 Use ( Use ) ,
268268}
269269
@@ -370,23 +370,23 @@ macro_rules! mod_items {
370370
371371mod_items ! {
372372ModItemId ->
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 ,
374376 ExternCrate in big_data -> ast:: ExternCrate ,
375- ExternBlock in big_data -> ast:: ExternBlock ,
376377 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 ,
381383 Static in small_data -> ast:: Static ,
384+ Struct in small_data -> ast:: Struct ,
382385 Trait in small_data -> ast:: Trait ,
383386 TraitAlias in small_data -> ast:: TraitAlias ,
384- Impl in small_data -> ast:: Impl ,
385387 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 ,
390390}
391391
392392impl Index < RawVisibilityId > for ItemTree {
@@ -425,7 +425,6 @@ impl Index<RawVisibilityId> for ItemTree {
425425#[ derive( Debug , Clone , Eq , PartialEq ) ]
426426pub struct Use {
427427 pub ( crate ) visibility : RawVisibilityId ,
428- pub ( crate ) ast_id : FileAstId < ast:: Use > ,
429428 pub ( crate ) use_tree : UseTree ,
430429}
431430
@@ -490,42 +489,36 @@ pub struct ExternCrate {
490489 pub name : Name ,
491490 pub alias : Option < ImportAlias > ,
492491 pub ( crate ) visibility : RawVisibilityId ,
493- pub ast_id : FileAstId < ast:: ExternCrate > ,
494492}
495493
496494#[ derive( Debug , Clone , Eq , PartialEq ) ]
497495pub struct ExternBlock {
498- pub ast_id : FileAstId < ast:: ExternBlock > ,
499496 pub ( crate ) children : Box < [ ModItemId ] > ,
500497}
501498
502499#[ derive( Debug , Clone , Eq , PartialEq ) ]
503500pub struct Function {
504501 pub name : Name ,
505502 pub ( crate ) visibility : RawVisibilityId ,
506- pub ast_id : FileAstId < ast:: Fn > ,
507503}
508504
509505#[ derive( Debug , Clone , Eq , PartialEq ) ]
510506pub struct Struct {
511507 pub name : Name ,
512508 pub ( crate ) visibility : RawVisibilityId ,
513509 pub shape : FieldsShape ,
514- pub ast_id : FileAstId < ast:: Struct > ,
515510}
516511
517512#[ derive( Debug , Clone , Eq , PartialEq ) ]
518513pub struct Union {
519514 pub name : Name ,
520515 pub ( crate ) visibility : RawVisibilityId ,
521- pub ast_id : FileAstId < ast:: Union > ,
522516}
523517
524518#[ derive( Debug , Clone , Eq , PartialEq ) ]
525519pub struct Enum {
526520 pub name : Name ,
527521 pub ( crate ) visibility : RawVisibilityId ,
528- pub ast_id : FileAstId < ast:: Enum > ,
529522}
530523
531524#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -564,48 +557,40 @@ pub struct Const {
564557 /// `None` for `const _: () = ();`
565558 pub name : Option < Name > ,
566559 pub ( crate ) visibility : RawVisibilityId ,
567- pub ast_id : FileAstId < ast:: Const > ,
568560}
569561
570562#[ derive( Debug , Clone , Eq , PartialEq ) ]
571563pub struct Static {
572564 pub name : Name ,
573565 pub ( crate ) visibility : RawVisibilityId ,
574- pub ast_id : FileAstId < ast:: Static > ,
575566}
576567
577568#[ derive( Debug , Clone , Eq , PartialEq ) ]
578569pub struct Trait {
579570 pub name : Name ,
580571 pub ( crate ) visibility : RawVisibilityId ,
581- pub ast_id : FileAstId < ast:: Trait > ,
582572}
583573
584574#[ derive( Debug , Clone , Eq , PartialEq ) ]
585575pub struct TraitAlias {
586576 pub name : Name ,
587577 pub ( crate ) visibility : RawVisibilityId ,
588- pub ast_id : FileAstId < ast:: TraitAlias > ,
589578}
590579
591580#[ derive( Debug , Clone , Eq , PartialEq ) ]
592- pub struct Impl {
593- pub ast_id : FileAstId < ast:: Impl > ,
594- }
581+ pub struct Impl { }
595582
596583#[ derive( Debug , Clone , PartialEq , Eq ) ]
597584pub struct TypeAlias {
598585 pub name : Name ,
599586 pub ( crate ) visibility : RawVisibilityId ,
600- pub ast_id : FileAstId < ast:: TypeAlias > ,
601587}
602588
603589#[ derive( Debug , Clone , Eq , PartialEq ) ]
604590pub struct Mod {
605591 pub name : Name ,
606592 pub ( crate ) visibility : RawVisibilityId ,
607593 pub ( crate ) kind : ModKind ,
608- pub ast_id : FileAstId < ast:: Module > ,
609594}
610595
611596#[ derive( Debug , Clone , Eq , PartialEq ) ]
@@ -620,7 +605,6 @@ pub(crate) enum ModKind {
620605pub struct MacroCall {
621606 /// Path to the called macro.
622607 pub path : Interned < ModPath > ,
623- pub ast_id : FileAstId < ast:: MacroCall > ,
624608 pub expand_to : ExpandTo ,
625609 pub ctxt : SyntaxContext ,
626610}
@@ -629,15 +613,13 @@ pub struct MacroCall {
629613pub struct MacroRules {
630614 /// The name of the declared macro.
631615 pub name : Name ,
632- pub ast_id : FileAstId < ast:: MacroRules > ,
633616}
634617
635618/// "Macros 2.0" macro definition.
636619#[ derive( Debug , Clone , Eq , PartialEq ) ]
637620pub struct Macro2 {
638621 pub name : Name ,
639622 pub ( crate ) visibility : RawVisibilityId ,
640- pub ast_id : FileAstId < ast:: MacroDef > ,
641623}
642624
643625#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
0 commit comments