@@ -28,25 +28,19 @@ crate struct Module<'hir> {
2828 crate statics : Vec < Static < ' hir > > ,
2929 crate constants : Vec < Constant < ' hir > > ,
3030 crate traits : Vec < Trait < ' hir > > ,
31- crate vis : & ' hir hir:: Visibility < ' hir > ,
3231 crate impls : Vec < Impl < ' hir > > ,
3332 crate foreigns : Vec < ForeignItem < ' hir > > ,
34- crate macros : Vec < Macro < ' hir > > ,
35- crate proc_macros : Vec < ProcMacro < ' hir > > ,
33+ crate macros : Vec < Macro > ,
34+ crate proc_macros : Vec < ProcMacro > ,
3635 crate trait_aliases : Vec < TraitAlias < ' hir > > ,
3736 crate is_crate : bool ,
3837}
3938
4039impl Module < ' hir > {
41- crate fn new (
42- name : Option < Symbol > ,
43- attrs : & ' hir [ ast:: Attribute ] ,
44- vis : & ' hir hir:: Visibility < ' hir > ,
45- ) -> Module < ' hir > {
40+ crate fn new ( name : Option < Symbol > , attrs : & ' hir [ ast:: Attribute ] ) -> Module < ' hir > {
4641 Module {
4742 name,
4843 id : hir:: CRATE_HIR_ID ,
49- vis,
5044 where_outer : rustc_span:: DUMMY_SP ,
5145 where_inner : rustc_span:: DUMMY_SP ,
5246 attrs,
@@ -83,53 +77,39 @@ crate enum StructType {
8377}
8478
8579crate struct Struct < ' hir > {
86- crate vis : & ' hir hir:: Visibility < ' hir > ,
8780 crate id : hir:: HirId ,
8881 crate struct_type : StructType ,
8982 crate name : Symbol ,
9083 crate generics : & ' hir hir:: Generics < ' hir > ,
91- crate attrs : & ' hir [ ast:: Attribute ] ,
9284 crate fields : & ' hir [ hir:: StructField < ' hir > ] ,
93- crate span : Span ,
9485}
9586
9687crate struct Union < ' hir > {
97- crate vis : & ' hir hir:: Visibility < ' hir > ,
9888 crate id : hir:: HirId ,
9989 crate struct_type : StructType ,
10090 crate name : Symbol ,
10191 crate generics : & ' hir hir:: Generics < ' hir > ,
102- crate attrs : & ' hir [ ast:: Attribute ] ,
10392 crate fields : & ' hir [ hir:: StructField < ' hir > ] ,
104- crate span : Span ,
10593}
10694
10795crate struct Enum < ' hir > {
108- crate vis : & ' hir hir:: Visibility < ' hir > ,
10996 crate variants : Vec < Variant < ' hir > > ,
11097 crate generics : & ' hir hir:: Generics < ' hir > ,
111- crate attrs : & ' hir [ ast:: Attribute ] ,
11298 crate id : hir:: HirId ,
113- crate span : Span ,
11499 crate name : Symbol ,
115100}
116101
117102crate struct Variant < ' hir > {
118103 crate name : Symbol ,
119104 crate id : hir:: HirId ,
120- crate attrs : & ' hir [ ast:: Attribute ] ,
121105 crate def : & ' hir hir:: VariantData < ' hir > ,
122- crate span : Span ,
123106}
124107
125108crate struct Function < ' hir > {
126109 crate decl : & ' hir hir:: FnDecl < ' hir > ,
127- crate attrs : & ' hir [ ast:: Attribute ] ,
128110 crate id : hir:: HirId ,
129111 crate name : Symbol ,
130- crate vis : & ' hir hir:: Visibility < ' hir > ,
131112 crate header : hir:: FnHeader ,
132- crate span : Span ,
133113 crate generics : & ' hir hir:: Generics < ' hir > ,
134114 crate body : hir:: BodyId ,
135115}
@@ -139,18 +119,12 @@ crate struct Typedef<'hir> {
139119 crate gen : & ' hir hir:: Generics < ' hir > ,
140120 crate name : Symbol ,
141121 crate id : hir:: HirId ,
142- crate attrs : & ' hir [ ast:: Attribute ] ,
143- crate span : Span ,
144- crate vis : & ' hir hir:: Visibility < ' hir > ,
145122}
146123
147124crate struct OpaqueTy < ' hir > {
148125 crate opaque_ty : & ' hir hir:: OpaqueTy < ' hir > ,
149126 crate name : Symbol ,
150127 crate id : hir:: HirId ,
151- crate attrs : & ' hir [ ast:: Attribute ] ,
152- crate span : Span ,
153- crate vis : & ' hir hir:: Visibility < ' hir > ,
154128}
155129
156130#[ derive( Debug ) ]
@@ -169,10 +143,7 @@ crate struct Constant<'hir> {
169143 crate type_ : & ' hir hir:: Ty < ' hir > ,
170144 crate expr : hir:: BodyId ,
171145 crate name : Symbol ,
172- crate attrs : & ' hir [ ast:: Attribute ] ,
173- crate vis : & ' hir hir:: Visibility < ' hir > ,
174146 crate id : hir:: HirId ,
175- crate span : Span ,
176147}
177148
178149crate struct Trait < ' hir > {
@@ -184,18 +155,13 @@ crate struct Trait<'hir> {
184155 crate bounds : & ' hir [ hir:: GenericBound < ' hir > ] ,
185156 crate attrs : & ' hir [ ast:: Attribute ] ,
186157 crate id : hir:: HirId ,
187- crate span : Span ,
188- crate vis : & ' hir hir:: Visibility < ' hir > ,
189158}
190159
191160crate struct TraitAlias < ' hir > {
192161 crate name : Symbol ,
193162 crate generics : & ' hir hir:: Generics < ' hir > ,
194163 crate bounds : & ' hir [ hir:: GenericBound < ' hir > ] ,
195- crate attrs : & ' hir [ ast:: Attribute ] ,
196164 crate id : hir:: HirId ,
197- crate span : Span ,
198- crate vis : & ' hir hir:: Visibility < ' hir > ,
199165}
200166
201167#[ derive( Debug ) ]
@@ -215,22 +181,16 @@ crate struct Impl<'hir> {
215181}
216182
217183crate struct ForeignItem < ' hir > {
218- crate vis : & ' hir hir:: Visibility < ' hir > ,
219184 crate id : hir:: HirId ,
220185 crate name : Symbol ,
221186 crate kind : & ' hir hir:: ForeignItemKind < ' hir > ,
222- crate attrs : & ' hir [ ast:: Attribute ] ,
223- crate span : Span ,
224187}
225188
226189// For Macro we store the DefId instead of the NodeId, since we also create
227190// these imported macro_rules (which only have a DUMMY_NODE_ID).
228- crate struct Macro < ' hir > {
191+ crate struct Macro {
229192 crate name : Symbol ,
230- crate hid : hir:: HirId ,
231193 crate def_id : hir:: def_id:: DefId ,
232- crate attrs : & ' hir [ ast:: Attribute ] ,
233- crate span : Span ,
234194 crate matchers : Vec < Span > ,
235195 crate imported_from : Option < Symbol > ,
236196}
@@ -256,13 +216,11 @@ crate struct Import<'hir> {
256216 crate span : Span ,
257217}
258218
259- crate struct ProcMacro < ' hir > {
219+ crate struct ProcMacro {
260220 crate name : Symbol ,
261221 crate id : hir:: HirId ,
262222 crate kind : MacroKind ,
263223 crate helpers : Vec < Symbol > ,
264- crate attrs : & ' hir [ ast:: Attribute ] ,
265- crate span : Span ,
266224}
267225
268226crate fn struct_type_from_def ( vdata : & hir:: VariantData < ' _ > ) -> StructType {
0 commit comments