@@ -289,7 +289,7 @@ struct Canonicalizer<'cx, 'tcx> {
289289 /// Set to `None` to disable the resolution of inference variables.
290290 infcx : Option < & ' cx InferCtxt < ' tcx > > ,
291291 tcx : TyCtxt < ' tcx > ,
292- variables : SmallVec < [ CanonicalVarKind < ' tcx > ; 8 ] > ,
292+ var_kinds : SmallVec < [ CanonicalVarKind < ' tcx > ; 8 ] > ,
293293 query_state : & ' cx mut OriginalQueryValues < ' tcx > ,
294294 // Note that indices is only used once `var_values` is big enough to be
295295 // heap-allocated.
@@ -507,7 +507,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
507507 {
508508 let base = Canonical {
509509 max_universe : ty:: UniverseIndex :: ROOT ,
510- variables : List :: empty ( ) ,
510+ var_kinds : List :: empty ( ) ,
511511 value : ( ) ,
512512 } ;
513513 Canonicalizer :: canonicalize_with_base (
@@ -548,7 +548,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
548548 tcx,
549549 canonicalize_mode : canonicalize_region_mode,
550550 needs_canonical_flags,
551- variables : SmallVec :: from_slice ( base. variables ) ,
551+ var_kinds : SmallVec :: from_slice ( base. var_kinds ) ,
552552 query_state,
553553 indices : FxHashMap :: default ( ) ,
554554 sub_root_lookup_table : Default :: default ( ) ,
@@ -569,16 +569,16 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
569569 // anymore.
570570 debug_assert ! ( !out_value. has_infer( ) && !out_value. has_placeholders( ) ) ;
571571
572- let canonical_variables =
573- tcx. mk_canonical_var_kinds ( & canonicalizer. universe_canonicalized_variables ( ) ) ;
572+ let canonical_var_kinds =
573+ tcx. mk_canonical_var_kinds ( & canonicalizer. universe_canonicalized_var_kinds ( ) ) ;
574574
575- let max_universe = canonical_variables
575+ let max_universe = canonical_var_kinds
576576 . iter ( )
577577 . map ( |cvar| cvar. universe ( ) )
578578 . max ( )
579579 . unwrap_or ( ty:: UniverseIndex :: ROOT ) ;
580580
581- Canonical { max_universe, variables : canonical_variables , value : ( base. value , out_value) }
581+ Canonical { max_universe, var_kinds : canonical_var_kinds , value : ( base. value , out_value) }
582582 }
583583
584584 /// Creates a canonical variable replacing `kind` from the input,
@@ -590,7 +590,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
590590 var_kind : CanonicalVarKind < ' tcx > ,
591591 value : GenericArg < ' tcx > ,
592592 ) -> BoundVar {
593- let Canonicalizer { variables , query_state, indices, .. } = self ;
593+ let Canonicalizer { var_kinds , query_state, indices, .. } = self ;
594594
595595 let var_values = & mut query_state. var_values ;
596596
@@ -607,7 +607,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
607607 }
608608 }
609609
610- // This code is hot. `variables ` and `var_values` are usually small
610+ // This code is hot. `var_kinds ` and `var_values` are usually small
611611 // (fewer than 8 elements ~95% of the time). They are SmallVec's to
612612 // avoid allocations in those cases. We also don't use `indices` to
613613 // determine if a kind has been seen before until the limit of 8 has
@@ -620,10 +620,10 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
620620 BoundVar :: new ( idx)
621621 } else {
622622 // `kind` isn't present in `var_values`. Append it. Likewise
623- // for `var_kind` and `variables `.
624- variables . push ( var_kind) ;
623+ // for `var_kind` and `var_kinds `.
624+ var_kinds . push ( var_kind) ;
625625 var_values. push ( value) ;
626- assert_eq ! ( variables . len( ) , var_values. len( ) ) ;
626+ assert_eq ! ( var_kinds . len( ) , var_values. len( ) ) ;
627627
628628 // If `var_values` has become big enough to be heap-allocated,
629629 // fill up `indices` to facilitate subsequent lookups.
@@ -641,27 +641,27 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
641641 } else {
642642 // `var_values` is large. Do a hashmap search via `indices`.
643643 * indices. entry ( value) . or_insert_with ( || {
644- variables . push ( var_kind) ;
644+ var_kinds . push ( var_kind) ;
645645 var_values. push ( value) ;
646- assert_eq ! ( variables . len( ) , var_values. len( ) ) ;
647- BoundVar :: new ( variables . len ( ) - 1 )
646+ assert_eq ! ( var_kinds . len( ) , var_values. len( ) ) ;
647+ BoundVar :: new ( var_kinds . len ( ) - 1 )
648648 } )
649649 }
650650 }
651651
652652 fn get_or_insert_sub_root ( & mut self , vid : ty:: TyVid ) -> ty:: BoundVar {
653653 let root_vid = self . infcx . unwrap ( ) . sub_unification_table_root_var ( vid) ;
654654 let idx =
655- * self . sub_root_lookup_table . entry ( root_vid) . or_insert_with ( || self . variables . len ( ) ) ;
655+ * self . sub_root_lookup_table . entry ( root_vid) . or_insert_with ( || self . var_kinds . len ( ) ) ;
656656 ty:: BoundVar :: from ( idx)
657657 }
658658
659659 /// Replaces the universe indexes used in `var_values` with their index in
660660 /// `query_state.universe_map`. This minimizes the maximum universe used in
661661 /// the canonicalized value.
662- fn universe_canonicalized_variables ( self ) -> SmallVec < [ CanonicalVarKind < ' tcx > ; 8 ] > {
662+ fn universe_canonicalized_var_kinds ( self ) -> SmallVec < [ CanonicalVarKind < ' tcx > ; 8 ] > {
663663 if self . query_state . universe_map . len ( ) == 1 {
664- return self . variables ;
664+ return self . var_kinds ;
665665 }
666666
667667 let reverse_universe_map: FxHashMap < ty:: UniverseIndex , ty:: UniverseIndex > = self
@@ -672,7 +672,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
672672 . map ( |( idx, universe) | ( * universe, ty:: UniverseIndex :: from_usize ( idx) ) )
673673 . collect ( ) ;
674674
675- self . variables
675+ self . var_kinds
676676 . iter ( )
677677 . map ( |& kind| match kind {
678678 CanonicalVarKind :: Int | CanonicalVarKind :: Float => {
0 commit comments