@@ -40,7 +40,7 @@ use rustc_metadata::cstore::CStore;
4040use syntax:: ext:: hygiene:: { ExpnId , Transparency , SyntaxContext } ;
4141use syntax:: ast:: { self , Name , NodeId , Ident , FloatTy , IntTy , UintTy } ;
4242use syntax:: ext:: base:: { SyntaxExtension , MacroKind , SpecialDerives } ;
43- use syntax:: symbol:: { Symbol , kw, sym} ;
43+ use syntax:: symbol:: { kw, sym} ;
4444
4545use syntax:: visit:: { self , Visitor } ;
4646use syntax:: attr;
@@ -241,7 +241,7 @@ impl Segment {
241241
242242 fn names_to_string ( segments : & [ Segment ] ) -> String {
243243 names_to_string ( & segments. iter ( )
244- . map ( |seg| seg. ident )
244+ . map ( |seg| seg. ident . name )
245245 . collect :: < Vec < _ > > ( ) )
246246 }
247247}
@@ -951,7 +951,7 @@ pub struct Resolver<'a> {
951951 struct_constructors : DefIdMap < ( Res , ty:: Visibility ) > ,
952952
953953 /// Features enabled for this crate.
954- active_features : FxHashSet < Symbol > ,
954+ active_features : FxHashSet < Name > ,
955955
956956 /// Stores enum visibilities to properly build a reduced graph
957957 /// when visiting the correspondent variants.
@@ -1018,8 +1018,8 @@ impl<'a> hir::lowering::Resolver for Resolver<'a> {
10181018 fn resolve_str_path (
10191019 & mut self ,
10201020 span : Span ,
1021- crate_root : Option < Symbol > ,
1022- components : & [ Symbol ] ,
1021+ crate_root : Option < Name > ,
1022+ components : & [ Name ] ,
10231023 ns : Namespace ,
10241024 ) -> ( ast:: Path , Res ) {
10251025 let root = if crate_root. is_some ( ) {
@@ -2555,7 +2555,7 @@ impl<'a> Resolver<'a> {
25552555 fn add_suggestion_for_rename_of_use (
25562556 & self ,
25572557 err : & mut DiagnosticBuilder < ' _ > ,
2558- name : Symbol ,
2558+ name : Name ,
25592559 directive : & ImportDirective < ' _ > ,
25602560 binding_span : Span ,
25612561 ) {
@@ -2770,38 +2770,37 @@ impl<'a> Resolver<'a> {
27702770 }
27712771}
27722772
2773- fn names_to_string ( idents : & [ Ident ] ) -> String {
2773+ fn names_to_string ( names : & [ Name ] ) -> String {
27742774 let mut result = String :: new ( ) ;
2775- for ( i, ident ) in idents . iter ( )
2776- . filter ( |ident| ident . name != kw:: PathRoot )
2775+ for ( i, name ) in names . iter ( )
2776+ . filter ( |name| * * name != kw:: PathRoot )
27772777 . enumerate ( ) {
27782778 if i > 0 {
27792779 result. push_str ( "::" ) ;
27802780 }
2781- result. push_str ( & ident . as_str ( ) ) ;
2781+ result. push_str ( & name . as_str ( ) ) ;
27822782 }
27832783 result
27842784}
27852785
27862786fn path_names_to_string ( path : & Path ) -> String {
27872787 names_to_string ( & path. segments . iter ( )
2788- . map ( |seg| seg. ident )
2788+ . map ( |seg| seg. ident . name )
27892789 . collect :: < Vec < _ > > ( ) )
27902790}
27912791
27922792/// A somewhat inefficient routine to obtain the name of a module.
27932793fn module_to_string ( module : Module < ' _ > ) -> Option < String > {
27942794 let mut names = Vec :: new ( ) ;
27952795
2796- fn collect_mod ( names : & mut Vec < Ident > , module : Module < ' _ > ) {
2796+ fn collect_mod ( names : & mut Vec < Name > , module : Module < ' _ > ) {
27972797 if let ModuleKind :: Def ( .., name) = module. kind {
27982798 if let Some ( parent) = module. parent {
2799- names. push ( Ident :: with_dummy_span ( name) ) ;
2799+ names. push ( name) ;
28002800 collect_mod ( names, parent) ;
28012801 }
28022802 } else {
2803- // danger, shouldn't be ident?
2804- names. push ( Ident :: from_str ( "<opaque>" ) ) ;
2803+ names. push ( Name :: intern ( "<opaque>" ) ) ;
28052804 collect_mod ( names, module. parent . unwrap ( ) ) ;
28062805 }
28072806 }
@@ -2810,9 +2809,8 @@ fn module_to_string(module: Module<'_>) -> Option<String> {
28102809 if names. is_empty ( ) {
28112810 return None ;
28122811 }
2813- Some ( names_to_string ( & names. into_iter ( )
2814- . rev ( )
2815- . collect :: < Vec < _ > > ( ) ) )
2812+ names. reverse ( ) ;
2813+ Some ( names_to_string ( & names) )
28162814}
28172815
28182816#[ derive( Copy , Clone , Debug ) ]
0 commit comments