diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-25 16:32:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-25 16:32:18 -0700 |
| commit | 405502286d28baee4dc3a6152282d1e6fe6c6472 (patch) | |
| tree | 679088dc9e31d849582989a572a8685d9d7f2492 /lib/std/fmt.zig | |
| parent | abadad464090a897813e35539d669f707ea3a8b4 (diff) | |
| parent | f8b8259e5caf30bd87151a0dcad7867768930e6b (diff) | |
| download | zig-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/fmt.zig')
| -rw-r--r-- | lib/std/fmt.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index df8397fb93..37c9f77fec 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -1829,7 +1829,8 @@ pub inline fn comptimePrint(comptime fmt: []const u8, args: anytype) *const [cou var buf: [count(fmt, args):0]u8 = undefined; _ = bufPrint(&buf, fmt, args) catch unreachable; buf[buf.len] = 0; - return &buf; + const final = buf; + return &final; } } |
