aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-03-25 16:32:18 -0700
committerGitHub <noreply@github.com>2024-03-25 16:32:18 -0700
commit405502286d28baee4dc3a6152282d1e6fe6c6472 (patch)
tree679088dc9e31d849582989a572a8685d9d7f2492 /lib/std/meta.zig
parentabadad464090a897813e35539d669f707ea3a8b4 (diff)
parentf8b8259e5caf30bd87151a0dcad7867768930e6b (diff)
downloadzig-405502286d28baee4dc3a6152282d1e6fe6c6472.tar.gz
zig-405502286d28baee4dc3a6152282d1e6fe6c6472.zip
Merge pull request #19414 from mlugg/comptime-mutable-memory-yet-again
compiler: implement analysis-local comptime-mutable memory
Diffstat (limited to 'lib/std/meta.zig')
-rw-r--r--lib/std/meta.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig
index da0f629748..3ad2c2de13 100644
--- a/lib/std/meta.zig
+++ b/lib/std/meta.zig
@@ -465,7 +465,8 @@ pub fn fieldNames(comptime T: type) *const [fields(T).len][:0]const u8 {
var names: [fieldInfos.len][:0]const u8 = undefined;
// This concat can be removed with the next zig1 update.
for (&names, fieldInfos) |*name, field| name.* = field.name ++ "";
- break :blk &names;
+ const final = names;
+ break :blk &final;
};
}
@@ -506,7 +507,8 @@ pub fn tags(comptime T: type) *const [fields(T).len]T {
for (fieldInfos, 0..) |field, i| {
res[i] = @field(T, field.name);
}
- break :blk &res;
+ const final = res;
+ break :blk &final;
};
}