diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2024-09-12 19:50:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-12 19:50:38 +0100 |
| commit | 0001f91e4e1e51cd64cdd5c0a21451c8bad67233 (patch) | |
| tree | 9c3efb262890fa76a9b1d02c694dadad11c316f4 /lib/std/testing.zig | |
| parent | b95e0e09dcbe4ca948fd4098a8e3a4d90df9cb22 (diff) | |
| parent | 9271a89c65967ff0fed7011b4195abdd0f9195eb (diff) | |
| download | zig-0001f91e4e1e51cd64cdd5c0a21451c8bad67233.tar.gz zig-0001f91e4e1e51cd64cdd5c0a21451c8bad67233.zip | |
Merge pull request #21287 from linusg/deprecated-default-init
Replace deprecated default initializations with decl literals
Diffstat (limited to 'lib/std/testing.zig')
| -rw-r--r-- | lib/std/testing.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 2cc38749eb..91caa7d922 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -11,10 +11,10 @@ pub const FailingAllocator = @import("testing/failing_allocator.zig").FailingAll /// This should only be used in temporary test programs. pub const allocator = allocator_instance.allocator(); -pub var allocator_instance = b: { +pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{}) = b: { if (!builtin.is_test) @compileError("Cannot use testing allocator outside of test block"); - break :b std.heap.GeneralPurposeAllocator(.{}){}; + break :b .init; }; pub const failing_allocator = failing_allocator_instance.allocator(); |
