diff options
author | 2023-04-09 05:39:05 -0700 | |
---|---|---|
committer | 2023-04-09 05:39:05 -0700 | |
commit | 7bd6a1f86d99c1374cb1eb15ff263dc352a8837b (patch) | |
tree | 6b7646d6bf34ca83844f713b3be671dc71a40b37 | |
parent | 1e717dd941090b5c52f36445f3a53d41e1bc7894 (diff) | |
download | bun-7bd6a1f86d99c1374cb1eb15ff263dc352a8837b.tar.gz bun-7bd6a1f86d99c1374cb1eb15ff263dc352a8837b.tar.zst bun-7bd6a1f86d99c1374cb1eb15ff263dc352a8837b.zip |
Remove usages of `void{}` in favor of `{}`
See https://github.com/ziglang/zig/issues/15213
37 files changed, 201 insertions, 201 deletions
diff --git a/src/analytics/analytics_thread.zig b/src/analytics/analytics_thread.zig index 04c3c9aff..804960ecc 100644 --- a/src/analytics/analytics_thread.zig +++ b/src/analytics/analytics_thread.zig @@ -202,7 +202,7 @@ pub const Event = struct { const timestamp = if (millis < 0) 0 else @intCast(u64, millis); - return Event{ .timestamp = timestamp, .data = @unionInit(Data, @tagName(name), void{}) }; + return Event{ .timestamp = timestamp, .data = @unionInit(Data, @tagName(name), {}) }; } }; diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index 7c6473727..cd0e064f1 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -2437,7 +2437,7 @@ pub const Hash = struct { arguments: []const js.JSValueRef, exception: js.ExceptionRef, ) js.JSObjectRef { - return hashWrap(std.hash.Wyhash).hash(void{}, ctx, null, null, arguments, exception); + return hashWrap(std.hash.Wyhash).hash({}, ctx, null, null, arguments, exception); } fn hashWrap(comptime Hasher: anytype) type { return struct { diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index bc83a021b..a2a5ee6af 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -2742,7 +2742,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp pub fn onStartStreamingRequestBody(this: *RequestContext) JSC.WebCore.DrainResult { if (this.aborted) { return JSC.WebCore.DrainResult{ - .aborted = void{}, + .aborted = {}, }; } diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig index a411beac2..e33205f37 100644 --- a/src/bun.js/base.zig +++ b/src/bun.js/base.zig @@ -422,7 +422,7 @@ pub const To = struct { ); } else if (comptime ZigContextType == void) { return ctxfn( - void{}, + {}, ctx, function, thisObject, @@ -1140,7 +1140,7 @@ pub fn NewClassWithInstanceType( prop: js.JSStringRef, exception: js.ExceptionRef, ) callconv(.C) js.JSValueRef { - var this: ObjectPtrType(ZigType) = if (comptime ZigType == void) void{} else GetJSPrivateData(ZigType, obj) orelse return js.JSValueMakeUndefined(ctx); + var this: ObjectPtrType(ZigType) = if (comptime ZigType == void) {} else GetJSPrivateData(ZigType, obj) orelse return js.JSValueMakeUndefined(ctx); const Field = @TypeOf(@field( properties, @@ -1597,9 +1597,9 @@ pub fn NewClassWithInstanceType( // } else if (@hasField(definition, "get") and @hasField(definition, "set")) { // data[i] = NewStaticProperty(className, property_names[i], definition.get, definition.set); // } else if (@hasField(definition, "get")) { -// data[i] = NewStaticProperty(className, property_names[i], definition.get, void{}); +// data[i] = NewStaticProperty(className, property_names[i], definition.get, {}); // } else if (@hasField(definition, "set")) { -// data[i] = NewStaticProperty(className, property_names[i], void{}, definition.set); +// data[i] = NewStaticProperty(className, property_names[i], {}, definition.set); // } else { // @compileError(className ++ "." ++ property_names[i] ++ " missing lazy, get, or set"); // } diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig index d4da19f68..20ca7738a 100644 --- a/src/bun.js/bindings/bindings.zig +++ b/src/bun.js/bindings/bindings.zig @@ -444,7 +444,7 @@ pub const ZigString = extern struct { } pub fn cmpDesc(_: void, a: ZigString, b: ZigString) bool { - return strings.cmpStringsDesc(void{}, a.slice(), b.slice()); + return strings.cmpStringsDesc({}, a.slice(), b.slice()); } pub fn sortAsc(slice_: []ZigString) void { @@ -452,7 +452,7 @@ pub const ZigString = extern struct { } pub fn cmpAsc(_: void, a: ZigString, b: ZigString) bool { - return strings.cmpStringsAsc(void{}, a.slice(), b.slice()); + return strings.cmpStringsAsc({}, a.slice(), b.slice()); } pub inline fn init(slice_: []const u8) ZigString { diff --git a/src/bun.js/webcore/body.zig b/src/bun.js/webcore/body.zig index 58d3a99b4..13431e695 100644 --- a/src/bun.js/webcore/body.zig +++ b/src/bun.js/webcore/body.zig @@ -213,7 +213,7 @@ pub const Body = struct { onStartStreaming: ?*const fn (ctx: *anyopaque) JSC.WebCore.DrainResult = null, deinit: bool = false, - action: Action = Action{ .none = void{} }, + action: Action = Action{ .none = {} }, pub fn toAnyBlob(this: *PendingValue) ?AnyBlob { if (this.promise != null) @@ -364,7 +364,7 @@ pub const Body = struct { Null, }; - // pub const empty = Value{ .Empty = void{} }; + // pub const empty = Value{ .Empty = {} }; pub fn toReadableStream(this: *Value, globalThis: *JSGlobalObject) JSValue { JSC.markBinding(@src()); @@ -410,7 +410,7 @@ pub const Body = struct { } if (drain_result == .empty or drain_result == .aborted) { - this.* = .{ .Null = void{} }; + this.* = .{ .Null = {} }; return JSC.WebCore.ReadableStream.empty(globalThis); } @@ -451,7 +451,7 @@ pub const Body = struct { if (value.isEmptyOrUndefinedOrNull()) { return Body.Value{ - .Null = void{}, + .Null = {}, }; } @@ -976,7 +976,7 @@ pub fn BodyMixin(comptime Type: type) type { return handleBodyAlreadyUsed(globalObject); } - return value.Locked.setPromise(globalObject, .{ .getText = void{} }); + return value.Locked.setPromise(globalObject, .{ .getText = {} }); } var blob = value.useAsAnyBlob(); @@ -1018,7 +1018,7 @@ pub fn BodyMixin(comptime Type: type) type { if (value.Locked.promise != null) { return handleBodyAlreadyUsed(globalObject); } - return value.Locked.setPromise(globalObject, .{ .getJSON = void{} }); + return value.Locked.setPromise(globalObject, .{ .getJSON = {} }); } var blob = value.useAsAnyBlob(); @@ -1047,7 +1047,7 @@ pub fn BodyMixin(comptime Type: type) type { if (value.Locked.promise != null) { return handleBodyAlreadyUsed(globalObject); } - return value.Locked.setPromise(globalObject, .{ .getArrayBuffer = void{} }); + return value.Locked.setPromise(globalObject, .{ .getArrayBuffer = {} }); } var blob: AnyBlob = value.useAsAnyBlob(); @@ -1126,7 +1126,7 @@ pub fn BodyMixin(comptime Type: type) type { return handleBodyAlreadyUsed(globalObject); } - return value.Locked.setPromise(globalObject, .{ .getBlob = void{} }); + return value.Locked.setPromise(globalObject, .{ .getBlob = {} }); } var blob = value.use(); diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig index c39f73603..91215886d 100644 --- a/src/bun.js/webcore/streams.zig +++ b/src/bun.js/webcore/streams.zig @@ -1664,7 +1664,7 @@ pub const FileSink = struct { } if (this.requested_end or this.done) - return .{ .result = void{} }; + return .{ .result = {} }; this.requested_end = true; @@ -3226,7 +3226,7 @@ pub const ByteStream = struct { pub fn onStart(this: *@This()) StreamStart { if (this.has_received_last_chunk and this.buffer.items.len == 0) { - return .{ .empty = void{} }; + return .{ .empty = {} }; } if (this.has_received_last_chunk) { @@ -3234,7 +3234,7 @@ pub const ByteStream = struct { } if (this.highWaterMark == 0) { - return .{ .ready = void{} }; + return .{ .ready = {} }; } return .{ .chunk_size = @max(this.highWaterMark, std.mem.page_size) }; @@ -3412,7 +3412,7 @@ pub const ByteStream = struct { if (this.has_received_last_chunk) { return .{ - .done = void{}, + .done = {}, }; } diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig index 282d95b2f..808dfaff0 100644 --- a/src/bundler/bundle_v2.zig +++ b/src/bundler/bundle_v2.zig @@ -3700,7 +3700,7 @@ const LinkerContext = struct { // include its hash when we're calculating the hashes of all // dependencies of this chunk. if (other_chunk_index != chunk_index) - chunk_meta.dynamic_imports.put(other_chunk_index, void{}) catch unreachable; + chunk_meta.dynamic_imports.put(other_chunk_index, {}) catch unreachable; } } @@ -3764,7 +3764,7 @@ const LinkerContext = struct { // be moved to a separate chunk than the use of a symbol even if // the definition and use of that symbol are originally from the // same source file. - imports.put(ref_to_use, void{}) catch unreachable; + imports.put(ref_to_use, {}) catch unreachable; } } } @@ -3795,18 +3795,18 @@ const LinkerContext = struct { if (comptime Environment.allow_assert) debug("Cross-chunk export: {s}", .{deps.symbols.get(target_ref).?.original_name}); - imports.put(target_ref, void{}) catch unreachable; + imports.put(target_ref, {}) catch unreachable; } } // Ensure "exports" is included if the current output format needs it if (flags.force_include_exports_for_entry_point) { - imports.put(deps.wrapper_refs[chunk.entry_point.source_index].?, void{}) catch unreachable; + imports.put(deps.wrapper_refs[chunk.entry_point.source_index].?, {}) catch unreachable; } // Include the wrapper if present if (flags.wrap != .none) { - imports.put(deps.wrapper_refs[chunk.entry_point.source_index].?, void{}) catch unreachable; + imports.put(deps.wrapper_refs[chunk.entry_point.source_index].?, {}) catch unreachable; } } } @@ -3932,7 +3932,7 @@ const LinkerContext = struct { // of hash calculation. if (chunk_meta.dynamic_imports.count() > 0) { var dynamic_chunk_indices = chunk_meta.dynamic_imports.keys(); - std.sort.sort(Index.Int, dynamic_chunk_indices, void{}, std.sort.asc(Index.Int)); + std.sort.sort(Index.Int, dynamic_chunk_indices, {}, std.sort.asc(Index.Int)); var imports = chunk.cross_chunk_imports.listManaged(c.allocator); defer chunk.cross_chunk_imports.update(imports); @@ -4144,7 +4144,7 @@ const LinkerContext = struct { } } - std.sort.sort(StableRef, list.items, void{}, StableRef.isLessThan); + std.sort.sort(StableRef, list.items, {}, StableRef.isLessThan); break :brk list; }; defer sorted_imports_from_other_chunks.deinit(); @@ -6293,7 +6293,7 @@ const LinkerContext = struct { .ref = export_ref, }; } - std.sort.sort(StableRef, result.items, void{}, StableRef.isLessThan); + std.sort.sort(StableRef, result.items, {}, StableRef.isLessThan); } pub fn markFileReachableForCodeSplitting( @@ -7116,7 +7116,7 @@ const LinkerContext = struct { c.graph.meta.items(.probably_typescript_type)[source_index].put( c.allocator, import_ref, - void{}, + {}, ) catch unreachable; }, .ambiguous => { @@ -7706,7 +7706,7 @@ pub const CrossChunkImport = struct { item.export_alias = exports_to_other_chunks.get(item.ref).?; std.debug.assert(item.export_alias.len > 0); } - std.sort.sort(CrossChunkImport.Item, import_items.slice(), void{}, CrossChunkImport.Item.lessThan); + std.sort.sort(CrossChunkImport.Item, import_items.slice(), {}, CrossChunkImport.Item.lessThan); result.append(CrossChunkImport{ .chunk_index = chunk_index, @@ -7714,7 +7714,7 @@ pub const CrossChunkImport = struct { }) catch unreachable; } - std.sort.sort(CrossChunkImport, result.items, void{}, CrossChunkImport.lessThan); + std.sort.sort(CrossChunkImport, result.items, {}, CrossChunkImport.lessThan); } }; diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index f68cb454a..8614d10d7 100644 --- a/src/cli/create_command.zig +++ b/src/cli/create_command.zig @@ -540,7 +540,7 @@ pub const CreateCommand = struct { destination, &archive_context, void, - void{}, + {}, 1, false, false, @@ -757,17 +757,17 @@ pub const CreateCommand = struct { const Prune = struct { pub const packages = ComptimeStringMap(void, .{ - .{ "@parcel/babel-preset", void{} }, - .{ "@parcel/core", void{} }, - .{ "@swc/cli", void{} }, - .{ "@swc/core", void{} }, - .{ "@webpack/cli", void{} }, - .{ "react-scripts", void{} }, - .{ "webpack-cli", void{} }, - .{ "webpack", void{} }, + .{ "@parcel/babel-preset", {} }, + .{ "@parcel/core", {} }, + .{ "@swc/cli", {} }, + .{ "@swc/core", {} }, + .{ "@webpack/cli", {} }, + .{ "react-scripts", {} }, + .{ "webpack-cli", {} }, + .{ "webpack", {} }, // one of cosmic config's imports breaks stuff - .{ "cosmiconfig", void{} }, + .{ "cosmiconfig", {} }, }); pub var prune_count: u16 = 0; diff --git a/src/deps/boringssl.translated.zig b/src/deps/boringssl.translated.zig index c5bdad6ec..f2fdbe6a0 100644 --- a/src/deps/boringssl.translated.zig +++ b/src/deps/boringssl.translated.zig @@ -18858,7 +18858,7 @@ pub const SSL = opaque { SSL_ERROR_HANDBACK => return error.Handback, SSL_ERROR_WANT_RENEGOTIATE => return error.WantRenegotiate, SSL_ERROR_HANDSHAKE_HINTS_READY => return error.HandshakeHintsReady, - else => void{}, + else => {}, }; } diff --git a/src/deps/lol-html.zig b/src/deps/lol-html.zig index ff7b02ed1..60b7318db 100644 --- a/src/deps/lol-html.zig +++ b/src/deps/lol-html.zig @@ -219,7 +219,7 @@ pub const HTMLRewriter = opaque { text_chunk_handler_data, )) { -1 => error.Fail, - 0 => void{}, + 0 => {}, else => unreachable, }; } @@ -411,7 +411,7 @@ pub const Element = opaque { pub fn setAttribute(element: *Element, name: []const u8, value: []const u8) Error!void { auto_disable(); return switch (lol_html_element_set_attribute(element, ptrWithoutPanic(name), name.len, ptrWithoutPanic(value), value.len)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -419,7 +419,7 @@ pub const Element = opaque { pub fn removeAttribute(element: *Element, name: []const u8) Error!void { auto_disable(); return switch (lol_html_element_remove_attribute(element, ptrWithoutPanic(name), name.len)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -427,7 +427,7 @@ pub const Element = opaque { pub fn before(element: *Element, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_element_before(element, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -435,7 +435,7 @@ pub const Element = opaque { pub fn prepend(element: *Element, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_element_prepend(element, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -443,7 +443,7 @@ pub const Element = opaque { pub fn append(element: *Element, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_element_append(element, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -451,7 +451,7 @@ pub const Element = opaque { pub fn after(element: *Element, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_element_after(element, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -460,7 +460,7 @@ pub const Element = opaque { auto_disable(); return switch (lol_html_element_set_inner_content(element, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -474,7 +474,7 @@ pub const Element = opaque { pub fn replace(element: *Element, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_element_replace(element, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -503,7 +503,7 @@ pub const Element = opaque { pub fn onEndTag(element: *Element, end_tag_handler: lol_html_end_tag_handler_t, user_data: ?*anyopaque) Error!void { auto_disable(); return switch (lol_html_element_on_end_tag(element, end_tag_handler, user_data)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -520,7 +520,7 @@ pub const Element = opaque { pub fn setTagName(element: *Element, name: []const u8) Error!void { return switch (lol_html_element_tag_name_set(element, ptrWithoutPanic(name), name.len)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -571,7 +571,7 @@ pub const EndTag = opaque { pub fn before(end_tag: *EndTag, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_end_tag_before(end_tag, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -580,7 +580,7 @@ pub const EndTag = opaque { pub fn after(end_tag: *EndTag, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_end_tag_after(end_tag, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -598,7 +598,7 @@ pub const EndTag = opaque { pub fn setName(end_tag: *EndTag, name: []const u8) Error!void { auto_disable(); return switch (lol_html_end_tag_name_set(end_tag, ptrWithoutPanic(name), name.len)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -652,7 +652,7 @@ pub const Comment = opaque { pub fn setText(comment: *Comment, text: []const u8) Error!void { auto_disable(); return switch (lol_html_comment_text_set(comment, ptrWithoutPanic(text), text.len)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -661,7 +661,7 @@ pub const Comment = opaque { pub fn before(comment: *Comment, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_comment_before(comment, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -670,7 +670,7 @@ pub const Comment = opaque { pub fn replace(comment: *Comment, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_comment_before(comment, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -679,7 +679,7 @@ pub const Comment = opaque { pub fn after(comment: *Comment, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_comment_after(comment, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; @@ -704,7 +704,7 @@ pub const DocEnd = opaque { pub fn append(this: *DocEnd, content: []const u8, is_html: bool) Error!void { auto_disable(); return switch (lol_html_doc_end_append(this, ptrWithoutPanic(content), content.len, is_html)) { - 0 => void{}, + 0 => {}, -1 => error.Fail, else => unreachable, }; diff --git a/src/deps/uws.zig b/src/deps/uws.zig index af2027b63..e87e3280f 100644 --- a/src/deps/uws.zig +++ b/src/deps/uws.zig @@ -1079,7 +1079,7 @@ pub fn NewApp(comptime ssl: bool) type { .always_inline, handler, .{ - void{}, + {}, req, @ptrCast(*Response, @alignCast(@alignOf(*Response), res)), }, @@ -1253,7 +1253,7 @@ pub fn NewApp(comptime ssl: bool) type { const Wrapper = struct { pub fn handle(socket: ?*uws.ListenSocket, conf: uws_app_listen_config_t, data: ?*anyopaque) callconv(.C) void { if (comptime UserData == void) { - @call(.always_inline, handler, .{ void{}, @ptrCast(?*ThisApp.ListenSocket, socket), conf }); + @call(.always_inline, handler, .{ {}, @ptrCast(?*ThisApp.ListenSocket, socket), conf }); } else { @call(.always_inline, handler, .{ @ptrCast(UserData, @alignCast(@alignOf(UserData), data.?)), @@ -1276,7 +1276,7 @@ pub fn NewApp(comptime ssl: bool) type { const Wrapper = struct { pub fn handle(socket: ?*uws.ListenSocket, data: ?*anyopaque) callconv(.C) void { if (comptime UserData == void) { - @call(.always_inline, handler, .{ void{}, @ptrCast(?*ThisApp.ListenSocket, socket) }); + @call(.always_inline, handler, .{ {}, @ptrCast(?*ThisApp.ListenSocket, socket) }); } else { @call(.always_inline, handler, .{ @ptrCast(UserData, @alignCast(@alignOf(UserData), data.?)), @@ -1396,7 +1396,7 @@ pub fn NewApp(comptime ssl: bool) type { const Wrapper = struct { pub fn handle(this: *uws_res, amount: uintmax_t, data: ?*anyopaque) callconv(.C) bool { if (comptime UserDataType == void) { - return @call(.always_inline, handler, .{ void{}, amount, castRes(this) }); + return @call(.always_inline, handler, .{ {}, amount, castRes(this) }); } else { return @call(.always_inline, handler, .{ @ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), data.?)), @@ -1417,7 +1417,7 @@ pub fn NewApp(comptime ssl: bool) type { const Wrapper = struct { pub fn handle(this: *uws_res, user_data: ?*anyopaque) callconv(.C) void { if (comptime UserDataType == void) { - @call(.always_inline, handler, .{ void{}, castRes(this), void{} }); + @call(.always_inline, handler, .{ {}, castRes(this), {} }); } else { @call(.always_inline, handler, .{ @ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), user_data.?)), castRes(this) }); } @@ -1440,7 +1440,7 @@ pub fn NewApp(comptime ssl: bool) type { pub fn handle(this: *uws_res, chunk_ptr: [*c]const u8, len: usize, last: bool, user_data: ?*anyopaque) callconv(.C) void { if (comptime UserDataType == void) { @call(.always_inline, handler, .{ - void{}, + {}, castRes(this), if (len > 0) chunk_ptr[0..len] else "", last, @@ -1493,7 +1493,7 @@ pub fn NewApp(comptime ssl: bool) type { pub fn handle(user_data: ?*anyopaque) callconv(.C) void { if (comptime UserDataType == void) { @call(.always_inline, handler, .{ - void{}, + {}, }); } else { @call(.always_inline, handler, .{ @@ -1516,7 +1516,7 @@ pub fn NewApp(comptime ssl: bool) type { // pub fn handle(user_data: ?*anyopaque, fd: i32) callconv(.C) void { // if (comptime UserDataType == void) { // @call(.always_inline, handler, .{ - // void{}, + // {}, // fd, // }); // } else { @@ -1535,7 +1535,7 @@ pub fn NewApp(comptime ssl: bool) type { // pub fn handle(socket: *Socket) callconv(.C) ?*Socket { // if (comptime UserDataType == void) { // @call(.always_inline, handler, .{ - // void{}, + // {}, // fd, // }); // } else { diff --git a/src/fs.zig b/src/fs.zig index 79377d2fd..a3b50ec10 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -860,7 +860,7 @@ pub const FileSystem = struct { threadlocal var temp_entries_option: EntriesOption = undefined; pub fn readDirectory(fs: *RealFS, _dir: string, _handle: ?std.fs.Dir) !*EntriesOption { - return readDirectoryWithIterator(fs, _dir, _handle, void, void{}); + return readDirectoryWithIterator(fs, _dir, _handle, void, {}); } pub fn readDirectoryWithIterator(fs: *RealFS, _dir: string, _handle: ?std.fs.Dir, comptime Iterator: type, iterator: Iterator) !*EntriesOption { diff --git a/src/install/dependency.zig b/src/install/dependency.zig index 8f02cc404..6af2e7754 100644 --- a/src/install/dependency.zig +++ b/src/install/dependency.zig @@ -64,7 +64,7 @@ pub fn isLessThan(string_buf: []const u8, lhs: Dependency, rhs: Dependency) bool const lhs_name = lhs.name.slice(string_buf); const rhs_name = rhs.name.slice(string_buf); - return strings.cmpStringsAsc(void{}, lhs_name, rhs_name); + return strings.cmpStringsAsc({}, lhs_name, rhs_name); } pub fn countWithDifferentBuffers(this: *const Dependency, name_buf: []const u8, version_buf: []const u8, comptime StringBuilder: type, builder: StringBuilder) void { diff --git a/src/install/extract_tarball.zig b/src/install/extract_tarball.zig index df2238535..2244230ab 100644 --- a/src/install/extract_tarball.zig +++ b/src/install/extract_tarball.zig @@ -259,7 +259,7 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !Install.ExtractD extract_destination, null, void, - void{}, + {}, // for npm packages, the root dir is always "package" 1, true, @@ -271,7 +271,7 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !Install.ExtractD extract_destination, null, void, - void{}, + {}, // for npm packages, the root dir is always "package" 1, true, diff --git a/src/install/install.zig b/src/install/install.zig index 0ae273f79..94a984416 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -1053,7 +1053,7 @@ const PackageInstall = struct { path, 0, )) { - 0 => void{}, + 0 => {}, else => |errno| switch (std.os.errno(errno)) { .OPNOTSUPP => return error.NotSupported, .NOENT => return error.FileNotFound, @@ -1087,7 +1087,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1111,7 +1111,7 @@ const PackageInstall = struct { this.destination_dir_subpath, 0, )) { - 0 => .{ .success = void{} }, + 0 => .{ .success = {} }, else => |errno| switch (std.os.errno(errno)) { .OPNOTSUPP => error.NotSupported, .NOENT => error.FileNotFound, @@ -1198,7 +1198,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1259,7 +1259,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1354,7 +1354,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1532,7 +1532,7 @@ const PackageInstall = struct { } if (supported_method_to_use != .copyfile) return Result{ - .success = void{}, + .success = {}, }; // TODO: linux io_uring @@ -6982,9 +6982,9 @@ pub const PackageManager = struct { &installer, .{ .onExtract = PackageInstaller.installEnqueuedPackages, - .onResolve = void{}, - .onPackageManifestError = void{}, - .onPackageDownloadError = void{}, + .onResolve = {}, + .onPackageManifestError = {}, + .onPackageDownloadError = {}, }, log_level, ); @@ -7001,9 +7001,9 @@ pub const PackageManager = struct { &installer, .{ .onExtract = PackageInstaller.installEnqueuedPackages, - .onResolve = void{}, - .onPackageManifestError = void{}, - .onPackageDownloadError = void{}, + .onResolve = {}, + .onPackageManifestError = {}, + .onPackageDownloadError = {}, }, log_level, ); @@ -7016,9 +7016,9 @@ pub const PackageManager = struct { &installer, .{ .onExtract = PackageInstaller.installEnqueuedPackages, - .onResolve = void{}, - .onPackageManifestError = void{}, - .onPackageDownloadError = void{}, + .onResolve = {}, + .onPackageManifestError = {}, + .onPackageDownloadError = {}, }, log_level, ); diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig index 93cd15fb2..eab6ad9a3 100644 --- a/src/install/lockfile.zig +++ b/src/install/lockfile.zig @@ -2254,7 +2254,7 @@ pub const Package = extern struct { source: logger.Source, comptime features: Features, ) !void { - return package.parse(lockfile, allocator, log, source, void, void{}, features); + return package.parse(lockfile, allocator, log, source, void, {}, features); } pub fn parse( diff --git a/src/io/io_darwin.zig b/src/io/io_darwin.zig index d9c597735..e0a48c0e9 100644 --- a/src/io/io_darwin.zig +++ b/src/io/io_darwin.zig @@ -334,7 +334,7 @@ pub const OpenError = error{ pub const Syscall = struct { pub fn close(fd: std.os.fd_t) CloseError!void { return switch (darwin.getErrno(darwin.@"close$NOCANCEL"(fd))) { - .SUCCESS => void{}, + .SUCCESS => {}, .BADF => error.FileDescriptorInvalid, .IO => error.InputOutput, else => |err| asError(err), @@ -1203,7 +1203,7 @@ pub fn connect( assert(size == 4); break :brk switch (darwin.getErrno(rc)) { .SUCCESS => switch (@intToEnum(os.E, err_code)) { - .SUCCESS => void{}, + .SUCCESS => {}, .ACCES => error.PermissionDenied, .PERM => error.PermissionDenied, .ADDRINUSE => error.AddressInUse, @@ -1225,7 +1225,7 @@ pub fn connect( }; }, else => switch (darwin.getErrno(darwin.@"connect$NOCANCEL"(op.socket, &op.address.any, op.address.getOsSockLen()))) { - .SUCCESS => void{}, + .SUCCESS => {}, .ACCES => error.PermissionDenied, .PERM => error.PermissionDenied, .ADDRINUSE => error.AddressInUse, diff --git a/src/io/io_linux.zig b/src/io/io_linux.zig index 2339731f4..10e1ede0c 100644 --- a/src/io/io_linux.zig +++ b/src/io/io_linux.zig @@ -954,7 +954,7 @@ pub const Completion = struct { os.ECANCELED => error.Canceled, os.ETIME => {}, // A success. else => |errno| asError(errno), - } else void{}; + } else {}; completion.callback(completion.context, completion, &result); }, .write => { diff --git a/src/js_ast.zig b/src/js_ast.zig index d3f908fd0..cb291dc0f 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -1732,11 +1732,11 @@ pub const E = struct { } pub fn alphabetizeProperties(this: *Object) void { - std.sort.sort(G.Property, this.properties.slice(), void{}, Sorter.isLessThan); + std.sort.sort(G.Property, this.properties.slice(), {}, Sorter.isLessThan); } pub fn packageJSONSort(this: *Object) void { - std.sort.sort(G.Property, this.properties.slice(), void{}, PackageJSONSort.Fields.isLessThan); + std.sort.sort(G.Property, this.properties.slice(), {}, PackageJSONSort.Fields.isLessThan); } const PackageJSONSort = struct { diff --git a/src/js_lexer.zig b/src/js_lexer.zig index 2cf2af086..d96942f95 100644 --- a/src/js_lexer.zig +++ b/src/js_lexer.zig @@ -92,7 +92,7 @@ fn NewLexer_( const is_json = json_options.is_json; const json = json_options; const JSONBool = if (is_json) bool else void; - const JSONBoolDefault: JSONBool = if (is_json) true else void{}; + const JSONBoolDefault: JSONBool = if (is_json) true else {}; pub const Error = error{ UTF8Fail, diff --git a/src/js_lexer/identifier.zig b/src/js_lexer/identifier.zig index 3bd2098bb..4f011fcf3 100644 --- a/src/js_lexer/identifier.zig +++ b/src/js_lexer/identifier.zig @@ -209,14 +209,14 @@ pub const JumpTableInline = struct { // while (i < start_codepoints.len) : (i += 2) { // j = start_codepoints[i]; // while (j <= start_codepoints[i + 1]) : (j += 1) { -// try starts.put(j, void{}); +// try starts.put(j, {}); // } // } // i = 0; // while (i < part_codepoints.len) : (i += 2) { // j = part_codepoints[i]; // while (j <= part_codepoints[i + 1]) : (j += 1) { -// try parts.put(j, void{}); +// try parts.put(j, {}); // } // } // } diff --git a/src/js_lexer_tables.zig b/src/js_lexer_tables.zig index b9ad473f8..8fe95a754 100644 --- a/src/js_lexer_tables.zig +++ b/src/js_lexer_tables.zig @@ -193,15 +193,15 @@ pub const Keywords = ComptimeStringMap(T, .{ }); pub const StrictModeReservedWords = ComptimeStringMap(void, .{ - .{ "implements", void{} }, - .{ "interface", void{} }, - .{ "let", void{} }, - .{ "package", void{} }, - .{ "private", void{} }, - .{ "protected", void{} }, - .{ "public", void{} }, - .{ "static", void{} }, - .{ "yield", void{} }, + .{ "implements", {} }, + .{ "interface", {} }, + .{ "let", {} }, + .{ "package", {} }, + .{ "private", {} }, + .{ "protected", {} }, + .{ "public", {} }, + .{ "static", {} }, + .{ "yield", {} }, }); pub const StrictModeReservedWordsRemap = ComptimeStringMap(string, .{ diff --git a/src/js_parser.zig b/src/js_parser.zig index 0b2eb4a05..c3492c040 100644 --- a/src/js_parser.zig +++ b/src/js_parser.zig @@ -9507,8 +9507,7 @@ fn NewParser_( // this variable should not exist if we're not in a typescript file var had_type_only_imports = if (comptime is_typescript_enabled) false - else - void{}; + else {}; while (p.lexer.token != .t_close_brace) { // The alias may be a keyword; diff --git a/src/js_printer.zig b/src/js_printer.zig index 29cd66873..da6a7fcb7 100644 --- a/src/js_printer.zig +++ b/src/js_printer.zig @@ -840,7 +840,7 @@ fn NewPrinter( fn printHardcodedImportStatement(p: *Printer, import: S.Import) void { if (comptime !is_bun_platform) unreachable; - printInternalBunImport(p, import, void, void{}); + printInternalBunImport(p, import, void, {}); } fn printInternalBunImport(p: *Printer, import: S.Import, comptime Statement: type, statement: Statement) void { diff --git a/src/json_parser.zig b/src/json_parser.zig index 5eaf4d4d7..34ce785b0 100644 --- a/src/json_parser.zig +++ b/src/json_parser.zig @@ -242,13 +242,11 @@ fn JSONLikeParser_( var duplicates_node: DuplicateNodeType = if (comptime opts.json_warn_duplicate_keys) HashMapPool.get(p.allocator) - else - void{}; + else {}; var duplicates: HashMapType = if (comptime opts.json_warn_duplicate_keys) duplicates_node.data - else - void{}; + else {}; defer { if (comptime opts.json_warn_duplicate_keys) { diff --git a/src/mdx/mdx_parser.zig b/src/mdx/mdx_parser.zig index bd55eadd2..f8f9096e9 100644 --- a/src/mdx/mdx_parser.zig +++ b/src/mdx/mdx_parser.zig @@ -1368,7 +1368,7 @@ pub const MDParser = struct { .head_row_count = 1, .body_row_count = block.line_count -| 2, }, - else => void{}, + else => {}, }; if (!is_in_tight_list or comptime tag != .p) { @@ -1430,7 +1430,7 @@ pub const MDParser = struct { .li => try this.mdx.onLeaveBlock(tag, Block.LI, detail.li), .ul => try this.mdx.onLeaveBlock(tag, Block.UL, detail.ul), .ol => try this.mdx.onLeaveBlock(tag, Block.OL, detail.ol), - else => try this.mdx.onLeaveBlock(block.tag, void, void{}), + else => try this.mdx.onLeaveBlock(block.tag, void, {}), } this.containers.len -|= switch (block.tag) { .ul, .ol, .blockquote => 1, @@ -1443,7 +1443,7 @@ pub const MDParser = struct { .li => try this.mdx.onEnterBlock(tag, Block.LI, detail.li), .ul => try this.mdx.onEnterBlock(tag, Block.UL, detail.ul), .ol => try this.mdx.onEnterBlock(tag, Block.OL, detail.ol), - else => try this.mdx.onEnterBlock(block.tag, void, void{}), + else => try this.mdx.onEnterBlock(block.tag, void, {}), } switch (comptime tag) { @@ -1677,7 +1677,7 @@ pub const MDParser = struct { var line = &line_buf[0]; var offset: u32 = 0; - try this.mdx.onEnterBlock(.doc, void, void{}); + try this.mdx.onEnterBlock(.doc, void, {}); const len: u32 = this.size; while (offset < len) { @@ -1695,7 +1695,7 @@ pub const MDParser = struct { this.leaveChildContainers(0); this.processAllBlocks(); - try this.mdx.onLeaveBlock(.doc, void, void{}); + try this.mdx.onLeaveBlock(.doc, void, {}); } }; diff --git a/src/options.zig b/src/options.zig index 2e97b7f3d..f1983fd6a 100644 --- a/src/options.zig +++ b/src/options.zig @@ -300,62 +300,62 @@ pub const ExternalModules = struct { }; pub const NodeBuiltinsMap = ComptimeStringMap(void, .{ - .{ "_http_agent", void{} }, - .{ "_http_client", void{} }, - .{ "_http_common", void{} }, - .{ "_http_incoming", void{} }, - .{ "_http_outgoing", void{} }, - .{ "_http_server", void{} }, - .{ "_stream_duplex", void{} }, - .{ "_stream_passthrough", void{} }, - .{ "_stream_readable", void{} }, - .{ "_stream_transform", void{} }, - .{ "_stream_wrap", void{} }, - .{ "_stream_writable", void{} }, - .{ "_tls_common", void{} }, - .{ "_tls_wrap", void{} }, - .{ "assert", void{} }, - .{ "async_hooks", void{} }, - .{ "buffer", void{} }, - .{ "child_process", void{} }, - .{ "cluster", void{} }, - .{ "console", void{} }, - .{ "constants", void{} }, - .{ "crypto", void{} }, - .{ "dgram", void{} }, - .{ "diagnostics_channel", void{} }, - .{ "dns", void{} }, - .{ "domain", void{} }, - .{ "events", void{} }, - .{ "fs", void{} }, - .{ "http", void{} }, - .{ "http2", void{} }, - .{ "https", void{} }, - .{ "inspector", void{} }, - .{ "module", void{} }, - .{ "net", void{} }, - .{ "os", void{} }, - .{ "path", void{} }, - .{ "perf_hooks", void{} }, - .{ "process", void{} }, - .{ "punycode", void{} }, - .{ "querystring", void{} }, - .{ "readline", void{} }, - .{ "repl", void{} }, - .{ "stream", void{} }, - .{ "string_decoder", void{} }, - .{ "sys", void{} }, - .{ "timers", void{} }, - .{ "tls", void{} }, - .{ "trace_events", void{} }, - .{ "tty", void{} }, - .{ "url", void{} }, - .{ "util", void{} }, - .{ "v8", void{} }, - .{ "vm", void{} }, - .{ "wasi", void{} }, - .{ "worker_threads", void{} }, - .{ "zlib", void{} }, + .{ "_http_agent", {} }, + .{ "_http_client", {} }, + .{ "_http_common", {} }, + .{ "_http_incoming", {} }, + .{ "_http_outgoing", {} }, + .{ "_http_server", {} }, + .{ "_stream_duplex", {} }, + .{ "_stream_passthrough", {} }, + .{ "_stream_readable", {} }, + .{ "_stream_transform", {} }, + .{ "_stream_wrap", {} }, + .{ "_stream_writable", {} }, + .{ "_tls_common", {} }, + .{ "_tls_wrap", {} }, + .{ "assert", {} }, + .{ "async_hooks", {} }, + .{ "buffer", {} }, + .{ "child_process", {} }, + .{ "cluster", {} }, + .{ "console", {} }, + .{ "constants", {} }, + .{ "crypto", {} }, + .{ "dgram", {} }, + .{ "diagnostics_channel", {} }, + .{ "dns", {} }, + .{ "domain", {} }, + .{ "events", {} }, + .{ "fs", {} }, + .{ "http", {} }, + .{ "http2", {} }, + .{ "https", {} }, + .{ "inspector", {} }, + .{ "module", {} }, + .{ "net", {} }, + .{ "os", {} }, + .{ "path", {} }, + .{ "perf_hooks", {} }, + .{ "process", {} }, + .{ "punycode", {} }, + .{ "querystring", {} }, + .{ "readline", {} }, + .{ "repl", {} }, + .{ "stream", {} }, + .{ "string_decoder", {} }, + .{ "sys", {} }, + .{ "timers", {} }, + .{ "tls", {} }, + .{ "trace_events", {} }, + .{ "tty", {} }, + .{ "url", {} }, + .{ "util", {} }, + .{ "v8", {} }, + .{ "vm", {} }, + .{ "wasi", {} }, + .{ "worker_threads", {} }, + .{ "zlib", {} }, }); }; @@ -846,14 +846,14 @@ pub const ESMConditions = struct { try import_condition_map.ensureTotalCapacity(defaults.len + 1); try require_condition_map.ensureTotalCapacity(defaults.len + 1); - import_condition_map.putAssumeCapacityNoClobber(Platform.default_conditions_strings.import, void{}); - require_condition_map.putAssumeCapacityNoClobber(Platform.default_conditions_strings.require, void{}); - default_condition_amp.putAssumeCapacityNoClobber(Platform.default_conditions_strings.default, void{}); + import_condition_map.putAssumeCapacityNoClobber(Platform.default_conditions_strings.import, {}); + require_condition_map.putAssumeCapacityNoClobber(Platform.default_conditions_strings.require, {}); + default_condition_amp.putAssumeCapacityNoClobber(Platform.default_conditions_strings.default, {}); for (defaults) |default| { - default_condition_amp.putAssumeCapacityNoClobber(default, void{}); - import_condition_map.putAssumeCapacityNoClobber(default, void{}); - require_condition_map.putAssumeCapacityNoClobber(default, void{}); + default_condition_amp.putAssumeCapacityNoClobber(default, {}); + import_condition_map.putAssumeCapacityNoClobber(default, {}); + require_condition_map.putAssumeCapacityNoClobber(default, {}); } return ESMConditions{ diff --git a/src/output.zig b/src/output.zig index 1fed2d684..1f1a500a6 100644 --- a/src/output.zig +++ b/src/output.zig @@ -280,11 +280,11 @@ pub noinline fn printElapsedTo(elapsed: f64, comptime printerFn: anytype, ctx: a } pub fn printElapsed(elapsed: f64) void { - printElapsedToWithCtx(elapsed, Output.prettyError, false, void{}); + printElapsedToWithCtx(elapsed, Output.prettyError, false, {}); } pub fn printElapsedStdout(elapsed: f64) void { - printElapsedToWithCtx(elapsed, Output.pretty, false, void{}); + printElapsedToWithCtx(elapsed, Output.pretty, false, {}); } pub fn printStartEnd(start: i128, end: i128) void { diff --git a/src/renamer.zig b/src/renamer.zig index 88dcb769c..ce4bf9a6f 100644 --- a/src/renamer.zig +++ b/src/renamer.zig @@ -205,7 +205,7 @@ pub const NumberRenamer = struct { remaining = remaining[1..]; } std.debug.assert(remaining.len == 0); - std.sort.sort(u32, sorted.items, void{}, std.sort.asc(u32)); + std.sort.sort(u32, sorted.items, {}, std.sort.asc(u32)); for (sorted.items) |inner_index| { r.assignName(s, Ref.init(@intCast(Ref.Int, inner_index), source_index, false)); @@ -321,11 +321,11 @@ pub const NumberRenamer = struct { while (s) |scope| : (s = scope.parent) { if (scope.name_counts.containsAdapted(name, ctx)) { - return .{ .used = void{} }; + return .{ .used = {} }; } } - return .{ .unused = void{} }; + return .{ .unused = {} }; } }; diff --git a/src/resolver/package_json.zig b/src/resolver/package_json.zig index f7ff5f3e4..6cfe759ef 100644 --- a/src/resolver/package_json.zig +++ b/src/resolver/package_json.zig @@ -1043,7 +1043,7 @@ pub const ExportsMap = struct { switch (expr.data) { .e_null => { - return Entry{ .first_token = js_lexer.rangeOfIdentifier(this.source, expr.loc), .data = .{ .null = void{} } }; + return Entry{ .first_token = js_lexer.rangeOfIdentifier(this.source, expr.loc), .data = .{ .null = {} } }; }, .e_string => |str| { return Entry{ @@ -1103,7 +1103,7 @@ pub const ExportsMap = struct { map_data.deinit(this.allocator); this.allocator.free(expansion_keys); return Entry{ - .data = .{ .invalid = void{} }, + .data = .{ .invalid = {} }, .first_token = first_token, }; } @@ -1157,7 +1157,7 @@ pub const ExportsMap = struct { this.log.addRangeWarning(this.source, first_token, "This value must be a string, an object, an array, or null") catch unreachable; return Entry{ - .data = .{ .invalid = void{} }, + .data = .{ .invalid = {} }, .first_token = first_token, }; } @@ -1509,7 +1509,7 @@ pub const ESModule = struct { } if (strings.eqlComptime(subpath, ".")) { - var main_export = ExportsMap.Entry{ .data = .{ .null = void{} }, .first_token = logger.Range.None }; + var main_export = ExportsMap.Entry{ .data = .{ .null = {} }, .first_token = logger.Range.None }; if (switch (exports.data) { .string, .array, diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig index da2753772..4ef2c4819 100644 --- a/src/resolver/resolver.zig +++ b/src/resolver/resolver.zig @@ -1919,7 +1919,7 @@ pub const Resolver = struct { } var dir_iterator = open_dir.iterate(); while (dir_iterator.next() catch null) |_value| { - dir_entries_option.entries.addEntry(_value, allocator, void, void{}) catch unreachable; + dir_entries_option.entries.addEntry(_value, allocator, void, {}) catch unreachable; } } @@ -2535,7 +2535,7 @@ pub const Resolver = struct { } var dir_iterator = open_dir.iterate(); while (try dir_iterator.next()) |_value| { - dir_entries_option.entries.addEntry(_value, allocator, void, void{}) catch unreachable; + dir_entries_option.entries.addEntry(_value, allocator, void, {}) catch unreachable; } } diff --git a/src/runtime.zig b/src/runtime.zig index 55a5db8e4..953034ab8 100644 --- a/src/runtime.zig +++ b/src/runtime.zig @@ -396,7 +396,7 @@ pub const Runtime = struct { return std.mem.order(u8, a, b) == .lt; } }; - std.sort.sort(string, &list, void{}, Sorter.compare); + std.sort.sort(string, &list, {}, Sorter.compare); break :brk list; }; diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 889add550..a611b302e 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -1992,7 +1992,7 @@ pub fn escapeHTMLForLatin1Input(allocator: std.mem.Allocator, latin1: []const u8 } if (total == len) { - return .{ .original = void{} }; + return .{ .original = {} }; } var output = allo.alloc(u8, total) catch unreachable; @@ -2013,7 +2013,7 @@ pub fn escapeHTMLForLatin1Input(allocator: std.mem.Allocator, latin1: []const u8 '\'' => Escaped(u8){ .static = "'" }, '<' => Escaped(u8){ .static = "<" }, '>' => Escaped(u8){ .static = ">" }, - else => Escaped(u8){ .original = void{} }, + else => Escaped(u8){ .original = {} }, }, 2 => { const first: []const u8 = switch (latin1[0]) { @@ -2254,7 +2254,7 @@ pub fn escapeHTMLForLatin1Input(allocator: std.mem.Allocator, latin1: []const u8 if (!any_needs_escape) { if (comptime Environment.allow_assert) std.debug.assert(buf.capacity == 0); - return Escaped(u8){ .original = void{} }; + return Escaped(u8){ .original = {} }; } return Escaped(u8){ .allocated = try buf.toOwnedSlice() }; diff --git a/src/url.zig b/src/url.zig index 9c234ec03..fae2e84a4 100644 --- a/src/url.zig +++ b/src/url.zig @@ -870,7 +870,7 @@ pub const FormData = struct { pub fn get(content_type: []const u8) ?Encoding { if (strings.indexOf(content_type, "application/x-www-form-urlencoded") != null) - return Encoding{ .URLEncoded = void{} }; + return Encoding{ .URLEncoded = {} }; if (strings.indexOf(content_type, "multipart/form-data") == null) return null; diff --git a/src/watcher.zig b/src/watcher.zig index 0fe05fd48..b993a9a83 100644 --- a/src/watcher.zig +++ b/src/watcher.zig @@ -577,7 +577,7 @@ pub fn NewWatcher(comptime ContextType: type) type { } var all_events = watchevents[0..watch_event_id]; - std.sort.sort(WatchEvent, all_events, void{}, WatchEvent.sortByIndex); + std.sort.sort(WatchEvent, all_events, {}, WatchEvent.sortByIndex); var last_event_index: usize = 0; var last_event_id: INotify.EventListIndex = std.math.maxInt(INotify.EventListIndex); diff --git a/test/js/bun/ffi/ffi.test.fixture.callback.c b/test/js/bun/ffi/ffi.test.fixture.callback.c index 624f6cdd0..3b9a46577 100644 --- a/test/js/bun/ffi/ffi.test.fixture.callback.c +++ b/test/js/bun/ffi/ffi.test.fixture.callback.c @@ -286,6 +286,9 @@ ZIG_REPR_TYPE JSFunctionCall(void* jsGlobalObject, void* callFrame); bool my_callback_function(void* arg0); bool my_callback_function(void* arg0) { +#ifdef INJECT_BEFORE +INJECT_BEFORE; +#endif ZIG_REPR_TYPE arguments[1]; arguments[0] = PTR_TO_JSVALUE(arg0).asZigRepr; return (bool)JSVALUE_TO_BOOL(_FFI_Callback_call((void*)0x0000000000000000ULL, 1, arguments)); |