@@ -48,8 +48,7 @@ use rbml::reader;
4848use rbml;
4949use serialize:: Decodable ;
5050use syntax:: attr;
51- use syntax:: parse:: token:: { IdentInterner , special_idents} ;
52- use syntax:: parse:: token;
51+ use syntax:: parse:: token:: { self , IdentInterner } ;
5352use syntax:: ast;
5453use syntax:: abi:: Abi ;
5554use syntax:: codemap:: { self , Span , BytePos , NO_EXPANSION } ;
@@ -406,6 +405,7 @@ pub fn get_adt_def<'tcx>(intr: &IdentInterner,
406405 cdata : Cmd ,
407406 doc : rbml:: Doc ,
408407 tcx : & ty:: ctxt < ' tcx > ) -> Vec < ty:: FieldDefData < ' tcx , ' tcx > > {
408+ let mut index = 0 ;
409409 reader:: tagged_docs ( doc, tag_item_field) . map ( |f| {
410410 let ff = item_family ( f) ;
411411 match ff {
@@ -417,8 +417,9 @@ pub fn get_adt_def<'tcx>(intr: &IdentInterner,
417417 struct_field_family_to_visibility ( ff) )
418418 } ) . chain ( reader:: tagged_docs ( doc, tag_item_unnamed_field) . map ( |f| {
419419 let ff = item_family ( f) ;
420- ty:: FieldDefData :: new ( item_def_id ( f, cdata) ,
421- special_idents:: unnamed_field. name ,
420+ let name = intr. intern ( & index. to_string ( ) ) ;
421+ index += 1 ;
422+ ty:: FieldDefData :: new ( item_def_id ( f, cdata) , name,
422423 struct_field_family_to_visibility ( ff) )
423424 } ) ) . collect ( )
424425 }
@@ -1153,10 +1154,13 @@ fn struct_field_family_to_visibility(family: Family) -> hir::Visibility {
11531154pub fn get_struct_field_names ( intr : & IdentInterner , cdata : Cmd , id : DefIndex )
11541155 -> Vec < ast:: Name > {
11551156 let item = cdata. lookup_item ( id) ;
1157+ let mut index = 0 ;
11561158 reader:: tagged_docs ( item, tag_item_field) . map ( |an_item| {
11571159 item_name ( intr, an_item)
11581160 } ) . chain ( reader:: tagged_docs ( item, tag_item_unnamed_field) . map ( |_| {
1159- special_idents:: unnamed_field. name
1161+ let name = intr. intern ( & index. to_string ( ) ) ;
1162+ index += 1 ;
1163+ name
11601164 } ) ) . collect ( )
11611165}
11621166
0 commit comments