@@ -155,10 +155,17 @@ pub(super) struct DefData {
155155 pub ( super ) visibility : RawVisibility ,
156156}
157157
158+ #[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
159+ pub ( super ) enum StructDefKind {
160+ Record ,
161+ Tuple ,
162+ Unit ,
163+ }
164+
158165#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
159166pub ( super ) enum DefKind {
160167 Function ( FileAstId < ast:: FnDef > ) ,
161- Struct ( FileAstId < ast:: StructDef > ) ,
168+ Struct ( FileAstId < ast:: StructDef > , StructDefKind ) ,
162169 Union ( FileAstId < ast:: UnionDef > ) ,
163170 Enum ( FileAstId < ast:: EnumDef > ) ,
164171 Const ( FileAstId < ast:: ConstDef > ) ,
@@ -171,7 +178,7 @@ impl DefKind {
171178 pub fn ast_id ( & self ) -> FileAstId < ast:: ModuleItem > {
172179 match self {
173180 DefKind :: Function ( it) => it. upcast ( ) ,
174- DefKind :: Struct ( it) => it. upcast ( ) ,
181+ DefKind :: Struct ( it, _ ) => it. upcast ( ) ,
175182 DefKind :: Union ( it) => it. upcast ( ) ,
176183 DefKind :: Enum ( it) => it. upcast ( ) ,
177184 DefKind :: Const ( it) => it. upcast ( ) ,
@@ -236,9 +243,14 @@ impl RawItemsCollector {
236243 return ;
237244 }
238245 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+ } ;
239251 let id = self . source_ast_id_map . ast_id ( & it) ;
240252 let name = it. name ( ) ;
241- ( DefKind :: Struct ( id) , name)
253+ ( DefKind :: Struct ( id, kind ) , name)
242254 }
243255 ast:: ModuleItem :: UnionDef ( it) => {
244256 let id = self . source_ast_id_map . ast_id ( & it) ;
0 commit comments