Skip to content

Commit b226044

Browse files
committed
Auto merge of #129809 - matthiaskrgr:rollup-cyygnxh, r=matthiaskrgr
Rollup of 15 pull requests Successful merges: - #120221 (Don't make statement nonterminals match pattern nonterminals) - #126183 (Separate core search logic with search ui) - #129123 (rustdoc-json: Add test for `Self` type) - #129366 (linker: Synchronize native library search in rustc and linker) - #129527 (Don't use `TyKind` in a lint) - #129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - #129640 (Re-enable android tests/benches in alloc/core) - #129642 (Bump backtrace to 0.3.74~ish) - #129675 (allow BufReader::peek to be called on unsized types) - #129723 (Simplify some extern providers) - #129724 (Remove `Option<!>` return types.) - #129725 (Stop using `ty::GenericPredicates` for non-predicates_of queries) - #129731 (Allow running `./x.py test compiler`) - #129751 (interpret/visitor: make memory order iteration slightly more efficient) - #129754 (wasi: Fix sleeping for `Duration::MAX`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4a23c9f + b353534 commit b226044

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/helpers.rs

+5-8
Original file line numberDiff line numberDiff 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`.

0 commit comments

Comments
 (0)