@@ -292,12 +292,12 @@ fn item_path(item_doc: rbml::Doc) -> Vec<ast_map::PathElem> {
292292 result
293293}
294294
295- fn item_name ( intr : & IdentInterner , item : rbml:: Doc ) -> ast:: Ident {
295+ fn item_name ( intr : & IdentInterner , item : rbml:: Doc ) -> ast:: Name {
296296 let name = reader:: get_doc ( item, tag_paths_data_name) ;
297297 let string = name. as_str_slice ( ) ;
298298 match intr. find_equiv ( & string) {
299- None => token:: str_to_ident ( string) ,
300- Some ( val) => ast :: Ident :: new ( val) ,
299+ None => token:: intern ( string) ,
300+ Some ( val) => val,
301301 }
302302}
303303
@@ -457,7 +457,7 @@ fn each_child_of_item_or_crate(intr: Rc<IdentInterner>,
457457 item_doc : rbml:: Doc ,
458458 get_crate_data : GetCrateDataCb ,
459459 callback : |DefLike ,
460- ast:: Ident ,
460+ ast:: Name ,
461461 ast:: Visibility |) {
462462 // Iterate over all children.
463463 let _ = reader:: tagged_docs ( item_doc , tag_mod_child , |child_info_doc| {
@@ -579,7 +579,7 @@ fn each_child_of_item_or_crate(intr: Rc<IdentInterner>,
579579 child_def_id. krate ) ;
580580 // These items have a public visibility because they're part of
581581 // a public re-export.
582- callback ( def_like, token:: str_to_ident ( name) , ast:: Public ) ;
582+ callback ( def_like, token:: intern ( name) , ast:: Public ) ;
583583 }
584584 }
585585
@@ -592,7 +592,7 @@ pub fn each_child_of_item(intr: Rc<IdentInterner>,
592592 cdata : Cmd ,
593593 id : ast:: NodeId ,
594594 get_crate_data : GetCrateDataCb ,
595- callback : |DefLike , ast:: Ident , ast:: Visibility |) {
595+ callback : |DefLike , ast:: Name , ast:: Visibility |) {
596596 // Find the item.
597597 let root_doc = rbml:: Doc :: new ( cdata. data ( ) ) ;
598598 let items = reader:: get_doc ( root_doc, tag_items) ;
@@ -613,7 +613,7 @@ pub fn each_top_level_item_of_crate(intr: Rc<IdentInterner>,
613613 cdata : Cmd ,
614614 get_crate_data : GetCrateDataCb ,
615615 callback : |DefLike ,
616- ast:: Ident ,
616+ ast:: Name ,
617617 ast:: Visibility |) {
618618 let root_doc = rbml:: Doc :: new ( cdata. data ( ) ) ;
619619 let misc_info_doc = reader:: get_doc ( root_doc, tag_misc_info) ;
@@ -745,7 +745,7 @@ pub fn get_impl_items(cdata: Cmd, impl_id: ast::NodeId)
745745pub fn get_trait_item_name_and_kind ( intr : Rc < IdentInterner > ,
746746 cdata : Cmd ,
747747 id : ast:: NodeId )
748- -> ( ast:: Ident , TraitItemKind ) {
748+ -> ( ast:: Name , TraitItemKind ) {
749749 let doc = lookup_item ( id, cdata. data ( ) ) ;
750750 let name = item_name ( & * intr, doc) ;
751751 match item_sort ( doc) {
@@ -800,7 +800,7 @@ pub fn get_impl_or_trait_item(intr: Rc<IdentInterner>,
800800 }
801801 't' => {
802802 ty:: TypeTraitItem ( Rc :: new ( ty:: AssociatedType {
803- ident : name,
803+ name : name,
804804 vis : vis,
805805 def_id : def_id,
806806 container : container,
@@ -885,15 +885,15 @@ pub fn get_supertraits(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
885885}
886886
887887pub fn get_type_name_if_impl ( cdata : Cmd ,
888- node_id : ast:: NodeId ) -> Option < ast:: Ident > {
888+ node_id : ast:: NodeId ) -> Option < ast:: Name > {
889889 let item = lookup_item ( node_id, cdata. data ( ) ) ;
890890 if item_family ( item) != Impl {
891891 return None ;
892892 }
893893
894894 let mut ret = None ;
895895 reader:: tagged_docs ( item, tag_item_impl_type_basename, |doc| {
896- ret = Some ( token:: str_to_ident ( doc. as_str_slice ( ) ) ) ;
896+ ret = Some ( token:: intern ( doc. as_str_slice ( ) ) ) ;
897897 false
898898 } ) ;
899899
@@ -936,7 +936,7 @@ pub fn get_static_methods_if_impl(intr: Rc<IdentInterner>,
936936 }
937937
938938 static_impl_methods. push ( StaticMethodInfo {
939- ident : item_name ( & * intr, impl_method_doc) ,
939+ name : item_name ( & * intr, impl_method_doc) ,
940940 def_id : item_def_id ( impl_method_doc, cdata) ,
941941 fn_style : fn_style,
942942 vis : item_visibility ( impl_method_doc) ,
@@ -1005,13 +1005,12 @@ pub fn get_struct_fields(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId)
10051005 reader:: tagged_docs ( item, tag_item_field, |an_item| {
10061006 let f = item_family ( an_item) ;
10071007 if f == PublicField || f == InheritedField {
1008- // FIXME #6993: name should be of type Name, not Ident
10091008 let name = item_name ( & * intr, an_item) ;
10101009 let did = item_def_id ( an_item, cdata) ;
10111010 let tagdoc = reader:: get_doc ( an_item, tag_item_field_origin) ;
10121011 let origin_id = translate_def_id ( cdata, reader:: with_doc_data ( tagdoc, parse_def_id) ) ;
10131012 result. push ( ty:: field_ty {
1014- name : name. name ,
1013+ name : name,
10151014 id : did,
10161015 vis : struct_field_family_to_visibility ( f) ,
10171016 origin : origin_id,
@@ -1393,7 +1392,7 @@ fn doc_generics(base_doc: rbml::Doc,
13931392 reader:: tagged_docs ( doc, tag_region_param_def, |rp_doc| {
13941393 let ident_str_doc = reader:: get_doc ( rp_doc,
13951394 tag_region_param_def_ident) ;
1396- let ident = item_name ( & * token:: get_ident_interner ( ) , ident_str_doc) ;
1395+ let name = item_name ( & * token:: get_ident_interner ( ) , ident_str_doc) ;
13971396 let def_id_doc = reader:: get_doc ( rp_doc,
13981397 tag_region_param_def_def_id) ;
13991398 let def_id = reader:: with_doc_data ( def_id_doc, parse_def_id) ;
@@ -1414,7 +1413,7 @@ fn doc_generics(base_doc: rbml::Doc,
14141413 true
14151414 } ) ;
14161415
1417- regions. push ( space, ty:: RegionParameterDef { name : ident . name ,
1416+ regions. push ( space, ty:: RegionParameterDef { name : name,
14181417 def_id : def_id,
14191418 space : space,
14201419 index : index,
0 commit comments