From ac562577381f6e94196337e0ccd8895bd1bcddb2 Mon Sep 17 00:00:00 2001 From: rohlem Date: Wed, 17 Sep 2025 23:11:46 +0200 Subject: [PATCH] langref: mention union support of `@fieldParentPtr` --- doc/langref.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index b7c9c7291e..bb3e00e656 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -4888,8 +4888,8 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val {#header_open|@fieldParentPtr#}
{#syntax#}@fieldParentPtr(comptime field_name: []const u8, field_ptr: *T) anytype{#endsyntax#}

- Given a pointer to a struct field, returns a pointer to the struct containing that field. - The return type (and struct in question) is the inferred result type. + Given a pointer to a struct or union field, returns a pointer to the struct or union containing that field. + The return type (pointer to the parent struct or union in question) is the inferred result type.

If {#syntax#}field_ptr{#endsyntax#} does not point to the {#syntax#}field_name{#endsyntax#} field of an instance of