@@ -4,7 +4,7 @@ use crate::traits;
44use crate :: traits:: project:: Normalized ;
55use crate :: ty:: fold:: { TypeFoldable , TypeFolder , TypeVisitor } ;
66use crate :: ty:: { self , Lift , Ty , TyCtxt } ;
7- use syntax:: symbol:: InternedString ;
7+ use syntax:: symbol:: Symbol ;
88
99use std:: fmt;
1010use std:: rc:: Rc ;
@@ -261,11 +261,11 @@ impl fmt::Display for traits::QuantifierKind {
261261/// for debug output in tests anyway.
262262struct BoundNamesCollector {
263263 // Just sort by name because `BoundRegion::BrNamed` does not have a `BoundVar` index anyway.
264- regions : BTreeSet < InternedString > ,
264+ regions : BTreeSet < Symbol > ,
265265
266266 // Sort by `BoundVar` index, so usually this should be equivalent to the order given
267267 // by the list of type parameters.
268- types : BTreeMap < u32 , InternedString > ,
268+ types : BTreeMap < u32 , Symbol > ,
269269
270270 binder_index : ty:: DebruijnIndex ,
271271}
@@ -312,8 +312,6 @@ impl<'tcx> TypeVisitor<'tcx> for BoundNamesCollector {
312312 }
313313
314314 fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> bool {
315- use syntax:: symbol:: Symbol ;
316-
317315 match t. sty {
318316 ty:: Bound ( debruijn, bound_ty) if debruijn == self . binder_index => {
319317 self . types . insert (
@@ -322,7 +320,7 @@ impl<'tcx> TypeVisitor<'tcx> for BoundNamesCollector {
322320 ty:: BoundTyKind :: Param ( name) => name,
323321 ty:: BoundTyKind :: Anon => Symbol :: intern (
324322 & format ! ( "^{}" , bound_ty. var. as_u32( ) )
325- ) . as_interned_str ( ) ,
323+ ) ,
326324 }
327325 ) ;
328326 }
@@ -334,8 +332,6 @@ impl<'tcx> TypeVisitor<'tcx> for BoundNamesCollector {
334332 }
335333
336334 fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
337- use syntax:: symbol:: Symbol ;
338-
339335 match r {
340336 ty:: ReLateBound ( index, br) if * index == self . binder_index => {
341337 match br {
@@ -346,7 +342,7 @@ impl<'tcx> TypeVisitor<'tcx> for BoundNamesCollector {
346342 ty:: BoundRegion :: BrAnon ( var) => {
347343 self . regions . insert ( Symbol :: intern (
348344 & format ! ( "'^{}" , var)
349- ) . as_interned_str ( ) ) ;
345+ ) ) ;
350346 }
351347
352348 _ => ( ) ,
0 commit comments