authorgravatar for marko03kostic@protonmail.commarko <marko03kostic@protonmail.com> 2025-09-17 14:33:40+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-17 19:45:33-07:00
log4314c9653a874451d1c9b3dbb8be08d966344028
treec447d725c34ae89182291e9a42cd7295028342c0
parentae00a2a84d34417c1fb6229db5919abcdced0ea0

use block break instead of return


1 files changed, 2 insertions(+), 4 deletions(-)

lib/std/hash/auto_hash.zig+2-4
......@@ -137,7 +137,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
137137 }
138138 },
139139
140 .@"union" => |info| {
140 .@"union" => |info| blk: {
141141 if (info.tag_type) |tag_type| {
142142 const tag = std.meta.activeTag(key);
143143 hash(hasher, tag, strat);
......@@ -146,9 +146,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
146146 if (field.type != void) {
147147 hash(hasher, @field(key, field.name), strat);
148148 }
149 // TODO use a labelled break when it does not crash the compiler. cf #2908
150 // break :blk;
151 return;
149 break :blk;
152150 }
153151 }
154152 unreachable;