@@ -155,10 +155,17 @@ pub(super) struct DefData {
155
155
pub ( super ) visibility : RawVisibility ,
156
156
}
157
157
158
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
159
+ pub ( super ) enum StructDefKind {
160
+ Record ,
161
+ Tuple ,
162
+ Unit ,
163
+ }
164
+
158
165
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
159
166
pub ( super ) enum DefKind {
160
167
Function ( FileAstId < ast:: FnDef > ) ,
161
- Struct ( FileAstId < ast:: StructDef > ) ,
168
+ Struct ( FileAstId < ast:: StructDef > , StructDefKind ) ,
162
169
Union ( FileAstId < ast:: UnionDef > ) ,
163
170
Enum ( FileAstId < ast:: EnumDef > ) ,
164
171
Const ( FileAstId < ast:: ConstDef > ) ,
@@ -171,7 +178,7 @@ impl DefKind {
171
178
pub fn ast_id ( & self ) -> FileAstId < ast:: ModuleItem > {
172
179
match self {
173
180
DefKind :: Function ( it) => it. upcast ( ) ,
174
- DefKind :: Struct ( it) => it. upcast ( ) ,
181
+ DefKind :: Struct ( it, _ ) => it. upcast ( ) ,
175
182
DefKind :: Union ( it) => it. upcast ( ) ,
176
183
DefKind :: Enum ( it) => it. upcast ( ) ,
177
184
DefKind :: Const ( it) => it. upcast ( ) ,
@@ -236,9 +243,14 @@ impl RawItemsCollector {
236
243
return ;
237
244
}
238
245
ast:: ModuleItem :: StructDef ( it) => {
246
+ let kind = match it. kind ( ) {
247
+ ast:: StructKind :: Record ( _) => StructDefKind :: Record ,
248
+ ast:: StructKind :: Tuple ( _) => StructDefKind :: Tuple ,
249
+ ast:: StructKind :: Unit => StructDefKind :: Unit ,
250
+ } ;
239
251
let id = self . source_ast_id_map . ast_id ( & it) ;
240
252
let name = it. name ( ) ;
241
- ( DefKind :: Struct ( id) , name)
253
+ ( DefKind :: Struct ( id, kind ) , name)
242
254
}
243
255
ast:: ModuleItem :: UnionDef ( it) => {
244
256
let id = self . source_ast_id_map . ast_id ( & it) ;
0 commit comments