@@ -30,7 +30,7 @@ use std::usize;
3030use rustc_data_structures:: indexed_vec:: Idx ;
3131use syntax:: abi:: Abi ;
3232use syntax:: ast:: CRATE_NODE_ID ;
33- use syntax:: symbol:: Symbol ;
33+ use syntax:: symbol:: { Symbol , InternedString } ;
3434use hir;
3535
3636macro_rules! gen_display_debug_body {
@@ -130,7 +130,7 @@ macro_rules! print {
130130}
131131
132132
133- struct LateBoundRegionNameCollector ( FxHashSet < Symbol > ) ;
133+ struct LateBoundRegionNameCollector ( FxHashSet < InternedString > ) ;
134134impl < ' tcx > ty:: fold:: TypeVisitor < ' tcx > for LateBoundRegionNameCollector {
135135 fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
136136 match * r {
@@ -148,7 +148,7 @@ pub struct PrintContext {
148148 is_debug : bool ,
149149 is_verbose : bool ,
150150 identify_regions : bool ,
151- used_region_names : Option < FxHashSet < Symbol > > ,
151+ used_region_names : Option < FxHashSet < InternedString > > ,
152152 region_index : usize ,
153153 binder_depth : usize ,
154154}
@@ -440,12 +440,12 @@ impl PrintContext {
440440 lifted : Option < ty:: Binder < U > > ) -> fmt:: Result
441441 where T : Print , U : Print + TypeFoldable < ' tcx > , F : fmt:: Write
442442 {
443- fn name_by_region_index ( index : usize ) -> Symbol {
443+ fn name_by_region_index ( index : usize ) -> InternedString {
444444 match index {
445445 0 => Symbol :: intern ( "'r" ) ,
446446 1 => Symbol :: intern ( "'s" ) ,
447447 i => Symbol :: intern ( & format ! ( "'t{}" , i-2 ) ) ,
448- }
448+ } . as_str ( )
449449 }
450450
451451 // Replace any anonymous late-bound regions with named
@@ -493,8 +493,7 @@ impl PrintContext {
493493 }
494494 } ;
495495 let _ = write ! ( f, "{}" , name) ;
496- ty:: BrNamed ( tcx. hir . local_def_id ( CRATE_NODE_ID ) ,
497- name)
496+ ty:: BrNamed ( tcx. hir . local_def_id ( CRATE_NODE_ID ) , name)
498497 }
499498 } ;
500499 tcx. mk_region ( ty:: ReLateBound ( ty:: DebruijnIndex :: new ( 1 ) , br) )
@@ -510,7 +509,7 @@ impl PrintContext {
510509 result
511510 }
512511
513- fn is_name_used ( & self , name : & Symbol ) -> bool {
512+ fn is_name_used ( & self , name : & InternedString ) -> bool {
514513 match self . used_region_names {
515514 Some ( ref names) => names. contains ( name) ,
516515 None => false ,
@@ -697,7 +696,7 @@ define_print! {
697696 BrAnon ( n) => write!( f, "BrAnon({:?})" , n) ,
698697 BrFresh ( n) => write!( f, "BrFresh({:?})" , n) ,
699698 BrNamed ( did, name) => {
700- write!( f, "BrNamed({:?}:{:?}, {:? })" ,
699+ write!( f, "BrNamed({:?}:{:?}, {})" ,
701700 did. krate, did. index, name)
702701 }
703702 BrEnv => write!( f, "BrEnv" ) ,
0 commit comments