From 16e0dc8929181719933404258246414ca4da9d3a Mon Sep 17 00:00:00 2001 From: Robbie Lyman Date: Tue, 10 Nov 2026 20:22:21 -0500 Subject: [PATCH] fix: packed -> bitpack --- build.zig | 2 +- src/DocumentScope.zig | 6 +++--- src/TrigramStore.zig | 2 +- src/analyser/InternPool.zig | 14 +++++++------- src/configuration.zig | 2 +- src/features/semantic_tokens.zig | 2 +- tests/lsp_features/completion.zig | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build.zig b/build.zig index 4bdb2da44f..abe155cb41 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const zls_version = std.SemanticVersion.parse(@import("build.zig.zon").version) const minimum_build_zig_version = @import("build.zig.zon").minimum_zig_version; /// Specifies the minimum Zig version that is runtime compatible with ZLS -const minimum_runtime_zig_version = "0.18.0-dev.897+117fd40fb"; +const minimum_runtime_zig_version = "0.18.0-dev.1007+3e4c8a80e"; const release_targets = [_]std.Target.Query{ .{ .cpu_arch = .aarch64, .os_tag = .linux }, diff --git a/src/DocumentScope.zig b/src/DocumentScope.zig index 9de5941012..d24f24cf74 100644 --- a/src/DocumentScope.zig +++ b/src/DocumentScope.zig @@ -241,11 +241,11 @@ pub const Scope = struct { } }; - pub const Data = packed union { + pub const Data = bitpack union { ast_node: Ast.Node.Index, }; - pub const SmallLoc = packed struct { + pub const SmallLoc = bitpack struct { start: u32, end: u32, }; @@ -270,7 +270,7 @@ pub const Scope = struct { }, }; - data: packed struct(u64) { + data: bitpack struct(u64) { tag: Tag, is_child_scopes_small: bool, is_child_decls_small: bool, diff --git a/src/TrigramStore.zig b/src/TrigramStore.zig index 637baaf0f8..982579cbf1 100644 --- a/src/TrigramStore.zig +++ b/src/TrigramStore.zig @@ -517,7 +517,7 @@ const CuckooFilter = struct { index_2: BucketIndex, pub fn initFromTrigram(trigram: Trigram, len: u32) Triplet { - const split: packed struct { + const split: bitpack struct { fingerprint: Fingerprint, padding: u24, index_1: u32, diff --git a/src/analyser/InternPool.zig b/src/analyser/InternPool.zig index 1cef0eeaf4..c0871a1b03 100644 --- a/src/analyser/InternPool.zig +++ b/src/analyser/InternPool.zig @@ -74,7 +74,7 @@ pub const Key = union(enum) { flags: Flags, packed_offset: PackedOffset = .{ .bit_offset = 0, .host_size = 0 }, - pub const Flags = packed struct(u32) { + pub const Flags = bitpack struct(u32) { size: std.lang.Type.Pointer.Size, is_const: bool = false, is_volatile: bool = false, @@ -84,7 +84,7 @@ pub const Key = union(enum) { alignment: u16 = 0, }; - pub const PackedOffset = packed struct(u32) { + pub const PackedOffset = bitpack struct(u32) { bit_offset: u16, host_size: u16, }; @@ -123,7 +123,7 @@ pub const Key = union(enum) { return_type: Index, flags: Flags = .{}, - pub const Flags = packed struct(u32) { + pub const Flags = bitpack struct(u32) { calling_convention: std.lang.CallingConvention.Tag = .auto, is_generic: bool = false, is_var_args: bool = false, @@ -197,7 +197,7 @@ pub const Key = union(enum) { } }; - const F64Value = packed struct { + const F64Value = bitpack struct { a: u32, b: u32, @@ -210,7 +210,7 @@ pub const Key = union(enum) { } }; - const F80Value = packed struct { + const F80Value = bitpack struct { a: u32, b: u32, c: u32, @@ -226,7 +226,7 @@ pub const Key = union(enum) { } }; - const F128Value = packed struct { + const F128Value = bitpack struct { a: u32, b: u32, c: u32, @@ -3349,7 +3349,7 @@ pub fn intInfo(ip: *InternPool, ty: Index, target: std.Target) std.lang.Type.Int }, .struct_type => |struct_index| { const struct_info = ip.getStruct(struct_index); - assert(struct_info.layout == .@"packed"); + assert(struct_info.layout == .@"bitpack"); index = struct_info.backing_int_ty; }, // TODO revisit this when error sets support custom int types (comment taken from zig codebase) diff --git a/src/configuration.zig b/src/configuration.zig index bf09947ebf..ff95fb7e34 100644 --- a/src/configuration.zig +++ b/src/configuration.zig @@ -640,7 +640,7 @@ pub const UnresolvedConfig = blk: { /// A packed struct where every field name is copied from `Config` but the field type is `bool`. pub const DidConfigChange = @Struct( - .@"packed", + .@"bitpack", null, @typeInfo(Config).@"struct".field_names, &@splat(bool), diff --git a/src/features/semantic_tokens.zig b/src/features/semantic_tokens.zig index 149348a946..81cebdab2e 100644 --- a/src/features/semantic_tokens.zig +++ b/src/features/semantic_tokens.zig @@ -46,7 +46,7 @@ pub const TokenType = enum(u32) { keywordLiteral, }; -pub const TokenModifiers = packed struct(u16) { +pub const TokenModifiers = bitpack struct(u16) { declaration: bool = false, definition: bool = false, readonly: bool = false, diff --git a/tests/lsp_features/completion.zig b/tests/lsp_features/completion.zig index 39bc6c6f70..874a86b066 100644 --- a/tests/lsp_features/completion.zig +++ b/tests/lsp_features/completion.zig @@ -3417,7 +3417,7 @@ test "function arguments of @Struct" { \\} , &.{ .{ .label = "@\"extern\"", .kind = .EnumMember }, - .{ .label = "@\"packed\"", .kind = .EnumMember }, + .{ .label = "@\"bitpack\"", .kind = .EnumMember }, .{ .label = "auto", .kind = .EnumMember }, }); } @@ -3429,7 +3429,7 @@ test "function arguments of @Union" { \\} , &.{ .{ .label = "@\"extern\"", .kind = .EnumMember }, - .{ .label = "@\"packed\"", .kind = .EnumMember }, + .{ .label = "@\"bitpack\"", .kind = .EnumMember }, .{ .label = "auto", .kind = .EnumMember }, }); }