@@ -487,7 +487,8 @@ pub struct InferenceResult<'db> {
487487 /// Whenever a tuple field expression access a tuple field, we allocate a tuple id in
488488 /// [`InferenceContext`] and store the tuples substitution there. This map is the reverse of
489489 /// that which allows us to resolve a [`TupleFieldId`]s type.
490- tuple_field_access_types : FxHashMap < TupleId , Tys < ' db > > ,
490+ #[ update( unsafe ( with( crate :: utils:: unsafe_update_eq /* thinvec is technically update */ ) ) ) ]
491+ tuple_field_access_types : ThinVec < Tys < ' db > > ,
491492
492493 #[ update( unsafe ( with( crate :: utils:: unsafe_update_eq /* expr id is technically update */ ) ) ) ]
493494 pub ( crate ) type_of_expr : ArenaMap < ExprId , Ty < ' db > > ,
@@ -685,7 +686,7 @@ impl<'db> InferenceResult<'db> {
685686 }
686687
687688 pub fn tuple_field_access_type ( & self , id : TupleId ) -> Tys < ' db > {
688- self . tuple_field_access_types [ & id ]
689+ self . tuple_field_access_types [ id . 0 as usize ]
689690 }
690691
691692 pub fn pat_adjustment ( & self , id : PatId ) -> Option < & [ Ty < ' db > ] > {
@@ -1148,9 +1149,8 @@ impl<'body, 'db> InferenceContext<'body, 'db> {
11481149 pat_adjustments. shrink_to_fit ( ) ;
11491150 result. tuple_field_access_types = tuple_field_accesses_rev
11501151 . into_iter ( )
1151- . enumerate ( )
1152- . map ( |( idx, subst) | ( TupleId ( idx as u32 ) , table. resolve_completely ( subst) ) )
1153- . inspect ( |( _, subst) | {
1152+ . map ( |subst| table. resolve_completely ( subst) )
1153+ . inspect ( |subst| {
11541154 * has_errors = * has_errors || subst. iter ( ) . any ( |ty| ty. references_non_lt_error ( ) ) ;
11551155 } )
11561156 . collect ( ) ;
0 commit comments