@@ -28,25 +28,19 @@ pub struct Module<'hir> {
2828 pub statics : Vec < Static < ' hir > > ,
2929 pub constants : Vec < Constant < ' hir > > ,
3030 pub traits : Vec < Trait < ' hir > > ,
31- pub vis : & ' hir hir:: Visibility < ' hir > ,
3231 pub impls : Vec < Impl < ' hir > > ,
3332 pub foreigns : Vec < ForeignItem < ' hir > > ,
3433 pub macros : Vec < Macro < ' hir > > ,
35- pub proc_macros : Vec < ProcMacro < ' hir > > ,
34+ pub proc_macros : Vec < ProcMacro > ,
3635 pub trait_aliases : Vec < TraitAlias < ' hir > > ,
3736 pub is_crate : bool ,
3837}
3938
4039impl Module < ' hir > {
41- pub fn new (
42- name : Option < Symbol > ,
43- attrs : & ' hir [ ast:: Attribute ] ,
44- vis : & ' hir hir:: Visibility < ' hir > ,
45- ) -> Module < ' hir > {
40+ pub 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 @@ pub enum StructType {
8377}
8478
8579pub struct Struct < ' hir > {
86- pub vis : & ' hir hir:: Visibility < ' hir > ,
8780 pub id : hir:: HirId ,
8881 pub struct_type : StructType ,
8982 pub name : Symbol ,
9083 pub generics : & ' hir hir:: Generics < ' hir > ,
91- pub attrs : & ' hir [ ast:: Attribute ] ,
9284 pub fields : & ' hir [ hir:: StructField < ' hir > ] ,
93- pub span : Span ,
9485}
9586
9687pub struct Union < ' hir > {
97- pub vis : & ' hir hir:: Visibility < ' hir > ,
9888 pub id : hir:: HirId ,
9989 pub struct_type : StructType ,
10090 pub name : Symbol ,
10191 pub generics : & ' hir hir:: Generics < ' hir > ,
102- pub attrs : & ' hir [ ast:: Attribute ] ,
10392 pub fields : & ' hir [ hir:: StructField < ' hir > ] ,
104- pub span : Span ,
10593}
10694
10795pub struct Enum < ' hir > {
108- pub vis : & ' hir hir:: Visibility < ' hir > ,
10996 pub variants : Vec < Variant < ' hir > > ,
11097 pub generics : & ' hir hir:: Generics < ' hir > ,
111- pub attrs : & ' hir [ ast:: Attribute ] ,
11298 pub id : hir:: HirId ,
113- pub span : Span ,
11499 pub name : Symbol ,
115100}
116101
117102pub struct Variant < ' hir > {
118103 pub name : Symbol ,
119104 pub id : hir:: HirId ,
120- pub attrs : & ' hir [ ast:: Attribute ] ,
121105 pub def : & ' hir hir:: VariantData < ' hir > ,
122- pub span : Span ,
123106}
124107
125108pub struct Function < ' hir > {
126109 pub decl : & ' hir hir:: FnDecl < ' hir > ,
127- pub attrs : & ' hir [ ast:: Attribute ] ,
128110 pub id : hir:: HirId ,
129111 pub name : Symbol ,
130- pub vis : & ' hir hir:: Visibility < ' hir > ,
131112 pub header : hir:: FnHeader ,
132- pub span : Span ,
133113 pub generics : & ' hir hir:: Generics < ' hir > ,
134114 pub body : hir:: BodyId ,
135115}
@@ -139,18 +119,12 @@ pub struct Typedef<'hir> {
139119 pub gen : & ' hir hir:: Generics < ' hir > ,
140120 pub name : Symbol ,
141121 pub id : hir:: HirId ,
142- pub attrs : & ' hir [ ast:: Attribute ] ,
143- pub span : Span ,
144- pub vis : & ' hir hir:: Visibility < ' hir > ,
145122}
146123
147124pub struct OpaqueTy < ' hir > {
148125 pub opaque_ty : & ' hir hir:: OpaqueTy < ' hir > ,
149126 pub name : Symbol ,
150127 pub id : hir:: HirId ,
151- pub attrs : & ' hir [ ast:: Attribute ] ,
152- pub span : Span ,
153- pub vis : & ' hir hir:: Visibility < ' hir > ,
154128}
155129
156130#[ derive( Debug ) ]
@@ -169,10 +143,7 @@ pub struct Constant<'hir> {
169143 pub type_ : & ' hir hir:: Ty < ' hir > ,
170144 pub expr : hir:: BodyId ,
171145 pub name : Symbol ,
172- pub attrs : & ' hir [ ast:: Attribute ] ,
173- pub vis : & ' hir hir:: Visibility < ' hir > ,
174146 pub id : hir:: HirId ,
175- pub span : Span ,
176147}
177148
178149pub struct Trait < ' hir > {
@@ -184,18 +155,13 @@ pub struct Trait<'hir> {
184155 pub bounds : & ' hir [ hir:: GenericBound < ' hir > ] ,
185156 pub attrs : & ' hir [ ast:: Attribute ] ,
186157 pub id : hir:: HirId ,
187- pub span : Span ,
188- pub vis : & ' hir hir:: Visibility < ' hir > ,
189158}
190159
191160pub struct TraitAlias < ' hir > {
192161 pub name : Symbol ,
193162 pub generics : & ' hir hir:: Generics < ' hir > ,
194163 pub bounds : & ' hir [ hir:: GenericBound < ' hir > ] ,
195- pub attrs : & ' hir [ ast:: Attribute ] ,
196164 pub id : hir:: HirId ,
197- pub span : Span ,
198- pub vis : & ' hir hir:: Visibility < ' hir > ,
199165}
200166
201167#[ derive( Debug ) ]
@@ -215,24 +181,19 @@ pub struct Impl<'hir> {
215181}
216182
217183pub struct ForeignItem < ' hir > {
218- pub vis : & ' hir hir:: Visibility < ' hir > ,
219184 pub id : hir:: HirId ,
220185 pub name : Symbol ,
221186 pub kind : & ' hir hir:: ForeignItemKind < ' hir > ,
222- pub attrs : & ' hir [ ast:: Attribute ] ,
223- pub 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).
228191pub struct Macro < ' hir > {
229192 pub name : Symbol ,
230- pub hid : hir:: HirId ,
231193 pub def_id : hir:: def_id:: DefId ,
232- pub attrs : & ' hir [ ast:: Attribute ] ,
233- pub span : Span ,
234194 pub matchers : Vec < Span > ,
235195 pub imported_from : Option < Symbol > ,
196+ pub attrs : & ' hir [ ast:: Attribute ] ,
236197}
237198
238199pub struct ExternCrate < ' hir > {
@@ -256,13 +217,11 @@ pub struct Import<'hir> {
256217 pub span : Span ,
257218}
258219
259- pub struct ProcMacro < ' hir > {
220+ pub struct ProcMacro {
260221 pub name : Symbol ,
261222 pub id : hir:: HirId ,
262223 pub kind : MacroKind ,
263224 pub helpers : Vec < Symbol > ,
264- pub attrs : & ' hir [ ast:: Attribute ] ,
265- pub span : Span ,
266225}
267226
268227pub fn struct_type_from_def ( vdata : & hir:: VariantData < ' _ > ) -> StructType {
0 commit comments