diff options
| author | Linus Groh <mail@linusgroh.de> | 2024-09-02 22:32:21 +0100 |
|---|---|---|
| committer | Linus Groh <mail@linusgroh.de> | 2024-09-12 16:01:23 +0100 |
| commit | 8588964972acc473c09e21958a7e52247c978603 (patch) | |
| tree | fb5e35e76e63b6d4aabdb0edf678d4d986a56110 /lib/std/testing.zig | |
| parent | eccd06f5d01d05286691bc77e6d1e582bb14b7b1 (diff) | |
| download | zig-8588964972acc473c09e21958a7e52247c978603.tar.gz zig-8588964972acc473c09e21958a7e52247c978603.zip | |
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(); |
