authorgravatar for manlio.perillo@gmail.comManlio Perillo <manlio.perillo@gmail.com> 2022-12-09 11:53:26+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-12-09 17:42:25+02:00
log505a21bcc5e06c156f33551e8abea90db438f41d
treeddb6e8570a1165973024d15e0abbf0549563550c
parentd88eb75a69d27ef50635f9aa1caf2a7177d99ead

langref: link "result location" to the "Result Location Semantics" section


1 files changed, 6 insertions(+), 5 deletions(-)

doc/langref.html.in+6-5
......@@ -2415,8 +2415,8 @@ test "anonymous list literal syntax" {
24152415}
24162416 {#code_end#}
24172417 <p>
2418 If there is no type in the result location then an anonymous list literal actually
2419 turns into a {#link|struct#} with numbered field names:
2418 If there is no type in the {#link|result location|Result Location Semantics#} then an
2419 anonymous list literal actually turns into a {#link|struct#} with numbered field names:
24202420 </p>
24212421 {#code_begin|test|infer_list_literal#}
24222422const std = @import("std");
......@@ -3497,7 +3497,8 @@ fn List(comptime T: type) type {
34973497 {#header_open|Anonymous Struct Literals#}
34983498 <p>
34993499 Zig allows omitting the struct type of a literal. When the result is {#link|coerced|Type Coercion#},
3500 the struct literal will directly instantiate the result location, with no copy:
3500 the struct literal will directly instantiate the {#link|result location|Result Location Semantics#},
3501 with no copy:
35013502 </p>
35023503 {#code_begin|test|struct_result#}
35033504const std = @import("std");
......@@ -3515,8 +3516,8 @@ test "anonymous struct literal" {
35153516}
35163517 {#code_end#}
35173518 <p>
3518 The struct type can be inferred. Here the result location does not include a type, and
3519 so Zig infers the type:
3519 The struct type can be inferred. Here the {#link|result location|Result Location Semantics#}
3520 does not include a type, and so Zig infers the type:
35203521 </p>
35213522 {#code_begin|test|struct_anon#}
35223523const std = @import("std");