File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -630,14 +630,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
630630 self . ecx
631631 }
632632
633- fn aggregate_field_order ( memory_index : & IndexVec < FieldIdx , u32 > , idx : usize ) -> usize {
634- // We need to do an *inverse* lookup: find the field that has position `idx` in memory order.
635- for ( src_field, & mem_pos) in memory_index. iter_enumerated ( ) {
636- if mem_pos as usize == idx {
637- return src_field. as_usize ( ) ;
638- }
639- }
640- panic ! ( "invalid `memory_index`, could not find {}-th field in memory order" , idx) ;
633+ fn aggregate_field_iter (
634+ memory_index : & IndexVec < FieldIdx , u32 > ,
635+ ) -> impl Iterator < Item = FieldIdx > + ' static {
636+ let inverse_memory_index = memory_index. invert_bijective_mapping ( ) ;
637+ inverse_memory_index. into_iter ( )
641638 }
642639
643640 // Hook to detect `UnsafeCell`.
You can’t perform that action at this time.
0 commit comments