From 505a21bcc5e06c156f33551e8abea90db438f41d Mon Sep 17 00:00:00 2001 From: Manlio Perillo Date: Fri, 9 Dec 2022 11:53:26 +0100 Subject: [PATCH] langref: link "result location" to the "Result Location Semantics" section --- doc/langref.html.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index b2e408dda7..eea77a5d7e 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -2415,8 +2415,8 @@ test "anonymous list literal syntax" { } {#code_end#}

- If there is no type in the result location then an anonymous list literal actually - turns into a {#link|struct#} with numbered field names: + If there is no type in the {#link|result location|Result Location Semantics#} then an + anonymous list literal actually turns into a {#link|struct#} with numbered field names:

{#code_begin|test|infer_list_literal#} const std = @import("std"); @@ -3497,7 +3497,8 @@ fn List(comptime T: type) type { {#header_open|Anonymous Struct Literals#}

Zig allows omitting the struct type of a literal. When the result is {#link|coerced|Type Coercion#}, - the struct literal will directly instantiate the result location, with no copy: + the struct literal will directly instantiate the {#link|result location|Result Location Semantics#}, + with no copy:

{#code_begin|test|struct_result#} const std = @import("std"); @@ -3515,8 +3516,8 @@ test "anonymous struct literal" { } {#code_end#}

- The struct type can be inferred. Here the result location does not include a type, and - so Zig infers the type: + The struct type can be inferred. Here the {#link|result location|Result Location Semantics#} + does not include a type, and so Zig infers the type:

{#code_begin|test|struct_anon#} const std = @import("std");