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