@@ -30,7 +30,7 @@ use std::usize;
30
30
use rustc_data_structures:: indexed_vec:: Idx ;
31
31
use syntax:: abi:: Abi ;
32
32
use syntax:: ast:: CRATE_NODE_ID ;
33
- use syntax:: symbol:: Symbol ;
33
+ use syntax:: symbol:: { Symbol , InternedString } ;
34
34
use hir;
35
35
36
36
macro_rules! gen_display_debug_body {
@@ -130,7 +130,7 @@ macro_rules! print {
130
130
}
131
131
132
132
133
- struct LateBoundRegionNameCollector ( FxHashSet < Symbol > ) ;
133
+ struct LateBoundRegionNameCollector ( FxHashSet < InternedString > ) ;
134
134
impl < ' tcx > ty:: fold:: TypeVisitor < ' tcx > for LateBoundRegionNameCollector {
135
135
fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
136
136
match * r {
@@ -148,7 +148,7 @@ pub struct PrintContext {
148
148
is_debug : bool ,
149
149
is_verbose : bool ,
150
150
identify_regions : bool ,
151
- used_region_names : Option < FxHashSet < Symbol > > ,
151
+ used_region_names : Option < FxHashSet < InternedString > > ,
152
152
region_index : usize ,
153
153
binder_depth : usize ,
154
154
}
@@ -440,12 +440,12 @@ impl PrintContext {
440
440
lifted : Option < ty:: Binder < U > > ) -> fmt:: Result
441
441
where T : Print , U : Print + TypeFoldable < ' tcx > , F : fmt:: Write
442
442
{
443
- fn name_by_region_index ( index : usize ) -> Symbol {
443
+ fn name_by_region_index ( index : usize ) -> InternedString {
444
444
match index {
445
445
0 => Symbol :: intern ( "'r" ) ,
446
446
1 => Symbol :: intern ( "'s" ) ,
447
447
i => Symbol :: intern ( & format ! ( "'t{}" , i-2 ) ) ,
448
- }
448
+ } . as_str ( )
449
449
}
450
450
451
451
// Replace any anonymous late-bound regions with named
@@ -493,8 +493,7 @@ impl PrintContext {
493
493
}
494
494
} ;
495
495
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)
498
497
}
499
498
} ;
500
499
tcx. mk_region ( ty:: ReLateBound ( ty:: DebruijnIndex :: new ( 1 ) , br) )
@@ -510,7 +509,7 @@ impl PrintContext {
510
509
result
511
510
}
512
511
513
- fn is_name_used ( & self , name : & Symbol ) -> bool {
512
+ fn is_name_used ( & self , name : & InternedString ) -> bool {
514
513
match self . used_region_names {
515
514
Some ( ref names) => names. contains ( name) ,
516
515
None => false ,
@@ -697,7 +696,7 @@ define_print! {
697
696
BrAnon ( n) => write!( f, "BrAnon({:?})" , n) ,
698
697
BrFresh ( n) => write!( f, "BrFresh({:?})" , n) ,
699
698
BrNamed ( did, name) => {
700
- write!( f, "BrNamed({:?}:{:?}, {:? })" ,
699
+ write!( f, "BrNamed({:?}:{:?}, {})" ,
701
700
did. krate, did. index, name)
702
701
}
703
702
BrEnv => write!( f, "BrEnv" ) ,
0 commit comments