commit d7d50496d91a8d2e2c1dafa4e92231672b266677 (tree)
parent 725dec6aa7a7ec48625d16e5ea4e2c730f73d9dd
Author: Andrew Kelley <andrew@ziglang.org>
Date: Wed, 10 Sep 2025 02:08:11 -0700
langref: don't assume too much about pointer to packed struct field
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/langref/test_overaligned_packed_struct.zig b/doc/langref/test_overaligned_packed_struct.zig
@@ -8,7 +8,7 @@ const S = packed struct {
test "overaligned pointer to packed struct" {
var foo: S align(4) = .{ .a = 1, .b = 2 };
const ptr: *align(4) S = &foo;
- const ptr_to_b: *u32 = &ptr.b;
+ const ptr_to_b = &ptr.b;
try expect(ptr_to_b.* == 2);
}