authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-01 02:42:48-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-08-01 12:42:48+03:00
log7e52a096dbace546cae89ab691741ecca45f28ce
tree62c95704bca0bdf557facc510f28b62b629550c0
parent32069d23301f624a7cdd4f1763c2de24f7a234ab
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

langref- fix packed struct error code


1 files changed, 2 insertions(+), 1 deletions(-)

doc/langref.html.in+2-1
...@@ -2846,7 +2846,7 @@ test "pointer to non-bit-aligned field" {...@@ -2846,7 +2846,7 @@ test "pointer to non-bit-aligned field" {
2846 Zig should correctly understand the alignment of fields. However there is2846 Zig should correctly understand the alignment of fields. However there is
2847 <a href="https://github.com/ziglang/zig/issues/1994">a bug</a>:2847 <a href="https://github.com/ziglang/zig/issues/1994">a bug</a>:
2848 </p>2848 </p>
2849 {#code_begin|test_err#}2849 {#code_begin|test_err|expected type '*u32', found '*align(1) u32'#}
2850const S = packed struct {2850const S = packed struct {
2851 a: u32,2851 a: u32,
2852 b: u32,2852 b: u32,
...@@ -2855,6 +2855,7 @@ test "overaligned pointer to packed struct" {...@@ -2855,6 +2855,7 @@ test "overaligned pointer to packed struct" {
2855 var foo: S align(4) = undefined;2855 var foo: S align(4) = undefined;
2856 const ptr: *align(4) S = &foo;2856 const ptr: *align(4) S = &foo;
2857 const ptr_to_b: *u32 = &ptr.b;2857 const ptr_to_b: *u32 = &ptr.b;
2858 _ = ptr_to_b;
2858}2859}
2859 {#code_end#}2860 {#code_end#}
2860 <p>When this bug is fixed, the above test in the documentation will unexpectedly pass, which will2861 <p>When this bug is fixed, the above test in the documentation will unexpectedly pass, which will