@@ -28,25 +28,19 @@ pub struct Module<'hir> {
28
28
pub statics : Vec < Static < ' hir > > ,
29
29
pub constants : Vec < Constant < ' hir > > ,
30
30
pub traits : Vec < Trait < ' hir > > ,
31
- pub vis : & ' hir hir:: Visibility < ' hir > ,
32
31
pub impls : Vec < Impl < ' hir > > ,
33
32
pub foreigns : Vec < ForeignItem < ' hir > > ,
34
33
pub macros : Vec < Macro < ' hir > > ,
35
- pub proc_macros : Vec < ProcMacro < ' hir > > ,
34
+ pub proc_macros : Vec < ProcMacro > ,
36
35
pub trait_aliases : Vec < TraitAlias < ' hir > > ,
37
36
pub is_crate : bool ,
38
37
}
39
38
40
39
impl 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 > {
46
41
Module {
47
42
name,
48
43
id : hir:: CRATE_HIR_ID ,
49
- vis,
50
44
where_outer : rustc_span:: DUMMY_SP ,
51
45
where_inner : rustc_span:: DUMMY_SP ,
52
46
attrs,
@@ -83,53 +77,39 @@ pub enum StructType {
83
77
}
84
78
85
79
pub struct Struct < ' hir > {
86
- pub vis : & ' hir hir:: Visibility < ' hir > ,
87
80
pub id : hir:: HirId ,
88
81
pub struct_type : StructType ,
89
82
pub name : Symbol ,
90
83
pub generics : & ' hir hir:: Generics < ' hir > ,
91
- pub attrs : & ' hir [ ast:: Attribute ] ,
92
84
pub fields : & ' hir [ hir:: StructField < ' hir > ] ,
93
- pub span : Span ,
94
85
}
95
86
96
87
pub struct Union < ' hir > {
97
- pub vis : & ' hir hir:: Visibility < ' hir > ,
98
88
pub id : hir:: HirId ,
99
89
pub struct_type : StructType ,
100
90
pub name : Symbol ,
101
91
pub generics : & ' hir hir:: Generics < ' hir > ,
102
- pub attrs : & ' hir [ ast:: Attribute ] ,
103
92
pub fields : & ' hir [ hir:: StructField < ' hir > ] ,
104
- pub span : Span ,
105
93
}
106
94
107
95
pub struct Enum < ' hir > {
108
- pub vis : & ' hir hir:: Visibility < ' hir > ,
109
96
pub variants : Vec < Variant < ' hir > > ,
110
97
pub generics : & ' hir hir:: Generics < ' hir > ,
111
- pub attrs : & ' hir [ ast:: Attribute ] ,
112
98
pub id : hir:: HirId ,
113
- pub span : Span ,
114
99
pub name : Symbol ,
115
100
}
116
101
117
102
pub struct Variant < ' hir > {
118
103
pub name : Symbol ,
119
104
pub id : hir:: HirId ,
120
- pub attrs : & ' hir [ ast:: Attribute ] ,
121
105
pub def : & ' hir hir:: VariantData < ' hir > ,
122
- pub span : Span ,
123
106
}
124
107
125
108
pub struct Function < ' hir > {
126
109
pub decl : & ' hir hir:: FnDecl < ' hir > ,
127
- pub attrs : & ' hir [ ast:: Attribute ] ,
128
110
pub id : hir:: HirId ,
129
111
pub name : Symbol ,
130
- pub vis : & ' hir hir:: Visibility < ' hir > ,
131
112
pub header : hir:: FnHeader ,
132
- pub span : Span ,
133
113
pub generics : & ' hir hir:: Generics < ' hir > ,
134
114
pub body : hir:: BodyId ,
135
115
}
@@ -139,18 +119,12 @@ pub struct Typedef<'hir> {
139
119
pub gen : & ' hir hir:: Generics < ' hir > ,
140
120
pub name : Symbol ,
141
121
pub id : hir:: HirId ,
142
- pub attrs : & ' hir [ ast:: Attribute ] ,
143
- pub span : Span ,
144
- pub vis : & ' hir hir:: Visibility < ' hir > ,
145
122
}
146
123
147
124
pub struct OpaqueTy < ' hir > {
148
125
pub opaque_ty : & ' hir hir:: OpaqueTy < ' hir > ,
149
126
pub name : Symbol ,
150
127
pub id : hir:: HirId ,
151
- pub attrs : & ' hir [ ast:: Attribute ] ,
152
- pub span : Span ,
153
- pub vis : & ' hir hir:: Visibility < ' hir > ,
154
128
}
155
129
156
130
#[ derive( Debug ) ]
@@ -169,10 +143,7 @@ pub struct Constant<'hir> {
169
143
pub type_ : & ' hir hir:: Ty < ' hir > ,
170
144
pub expr : hir:: BodyId ,
171
145
pub name : Symbol ,
172
- pub attrs : & ' hir [ ast:: Attribute ] ,
173
- pub vis : & ' hir hir:: Visibility < ' hir > ,
174
146
pub id : hir:: HirId ,
175
- pub span : Span ,
176
147
}
177
148
178
149
pub struct Trait < ' hir > {
@@ -184,18 +155,13 @@ pub struct Trait<'hir> {
184
155
pub bounds : & ' hir [ hir:: GenericBound < ' hir > ] ,
185
156
pub attrs : & ' hir [ ast:: Attribute ] ,
186
157
pub id : hir:: HirId ,
187
- pub span : Span ,
188
- pub vis : & ' hir hir:: Visibility < ' hir > ,
189
158
}
190
159
191
160
pub struct TraitAlias < ' hir > {
192
161
pub name : Symbol ,
193
162
pub generics : & ' hir hir:: Generics < ' hir > ,
194
163
pub bounds : & ' hir [ hir:: GenericBound < ' hir > ] ,
195
- pub attrs : & ' hir [ ast:: Attribute ] ,
196
164
pub id : hir:: HirId ,
197
- pub span : Span ,
198
- pub vis : & ' hir hir:: Visibility < ' hir > ,
199
165
}
200
166
201
167
#[ derive( Debug ) ]
@@ -215,24 +181,19 @@ pub struct Impl<'hir> {
215
181
}
216
182
217
183
pub struct ForeignItem < ' hir > {
218
- pub vis : & ' hir hir:: Visibility < ' hir > ,
219
184
pub id : hir:: HirId ,
220
185
pub name : Symbol ,
221
186
pub kind : & ' hir hir:: ForeignItemKind < ' hir > ,
222
- pub attrs : & ' hir [ ast:: Attribute ] ,
223
- pub span : Span ,
224
187
}
225
188
226
189
// For Macro we store the DefId instead of the NodeId, since we also create
227
190
// these imported macro_rules (which only have a DUMMY_NODE_ID).
228
191
pub struct Macro < ' hir > {
229
192
pub name : Symbol ,
230
- pub hid : hir:: HirId ,
231
193
pub def_id : hir:: def_id:: DefId ,
232
- pub attrs : & ' hir [ ast:: Attribute ] ,
233
- pub span : Span ,
234
194
pub matchers : Vec < Span > ,
235
195
pub imported_from : Option < Symbol > ,
196
+ pub attrs : & ' hir [ ast:: Attribute ] ,
236
197
}
237
198
238
199
pub struct ExternCrate < ' hir > {
@@ -256,13 +217,11 @@ pub struct Import<'hir> {
256
217
pub span : Span ,
257
218
}
258
219
259
- pub struct ProcMacro < ' hir > {
220
+ pub struct ProcMacro {
260
221
pub name : Symbol ,
261
222
pub id : hir:: HirId ,
262
223
pub kind : MacroKind ,
263
224
pub helpers : Vec < Symbol > ,
264
- pub attrs : & ' hir [ ast:: Attribute ] ,
265
- pub span : Span ,
266
225
}
267
226
268
227
pub fn struct_type_from_def ( vdata : & hir:: VariantData < ' _ > ) -> StructType {
0 commit comments