From cbed6bb08555222008e87cfb071adeed97b3f8a4 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Thu, 3 Nov 2022 02:42:18 -0400 Subject: Sema: make `InferredErrorSet` deterministic Empirically, this `AutoHashMapUnmanaged` -> `AutoArrayHashMapUnmanaged` change fixes all non-determinism in `ReleaseFast` build artifacts. Closes #12183 --- src/Sema.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Sema.zig') diff --git a/src/Sema.zig b/src/Sema.zig index b2a0dfa779..bd956d32bc 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -27509,9 +27509,7 @@ fn analyzeIsNonErrComptimeOnly( // Try to avoid resolving inferred error set if possible. if (ies.errors.count() != 0) break :blk; if (ies.is_anyerror) break :blk; - var it = ies.inferred_error_sets.keyIterator(); - while (it.next()) |other_error_set_ptr| { - const other_ies: *Module.Fn.InferredErrorSet = other_error_set_ptr.*; + for (ies.inferred_error_sets.keys()) |other_ies| { if (ies == other_ies) continue; try sema.resolveInferredErrorSet(block, src, other_ies); if (other_ies.is_anyerror) { @@ -29432,9 +29430,7 @@ fn resolveInferredErrorSet( ies.is_resolved = true; - var it = ies.inferred_error_sets.keyIterator(); - while (it.next()) |other_error_set_ptr| { - const other_ies: *Module.Fn.InferredErrorSet = other_error_set_ptr.*; + for (ies.inferred_error_sets.keys()) |other_ies| { if (ies == other_ies) continue; try sema.resolveInferredErrorSet(block, src, other_ies); -- cgit v1.2.3