Commit 4314c9653a

marko <marko03kostic@protonmail.com>
2025-09-17 14:33:40
use block break instead of return
1 parent ae00a2a
Changed files (1)
lib
std
lib/std/hash/auto_hash.zig
@@ -137,7 +137,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
             }
         },
 
-        .@"union" => |info| {
+        .@"union" => |info| blk: {
             if (info.tag_type) |tag_type| {
                 const tag = std.meta.activeTag(key);
                 hash(hasher, tag, strat);
@@ -146,9 +146,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
                         if (field.type != void) {
                             hash(hasher, @field(key, field.name), strat);
                         }
-                        // TODO use a labelled break when it does not crash the compiler. cf #2908
-                        // break :blk;
-                        return;
+                        break :blk;
                     }
                 }
                 unreachable;