mirror of
https://github.com/ziglang/zig.git
synced 2026-02-03 21:23:36 +00:00
Sema: make InferredErrorSet deterministic
Empirically, this `AutoHashMapUnmanaged` -> `AutoArrayHashMapUnmanaged` change fixes all non-determinism in `ReleaseFast` build artifacts. Closes #12183
This commit is contained in:
parent
42755a1944
commit
cbed6bb085
@ -1578,7 +1578,7 @@ pub const Fn = struct {
|
||||
errors: ErrorSet.NameMap = .{},
|
||||
|
||||
/// Other inferred error sets which this inferred error set should include.
|
||||
inferred_error_sets: std.AutoHashMapUnmanaged(*InferredErrorSet, void) = .{},
|
||||
inferred_error_sets: std.AutoArrayHashMapUnmanaged(*InferredErrorSet, void) = .{},
|
||||
|
||||
/// Whether the function returned anyerror. This is true if either of
|
||||
/// the dependent functions returns anyerror.
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user