diff --git a/std/mem.zig b/std/mem.zig index ba59faf711..bfd74669f2 100644 --- a/std/mem.zig +++ b/std/mem.zig @@ -34,7 +34,7 @@ pub const Allocator = struct { /// Call `destroy` with the result pub fn create(self: *Allocator, init: var) Error!*@typeOf(init) { const T = @typeOf(init); - if (@sizeOf(T) == 0) return &{}; + if (@sizeOf(T) == 0) return &T{}; const slice = try self.alloc(T, 1); const ptr = &slice[0]; ptr.* = init;