authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-11-21 19:56:15-08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-11-21 19:56:15-08:00
logd828115dabf3b06711788dc2f424a1ef3cedd6a3
tree11406fad4c3e6777081941252932ac54eea77c23
parentd54fbc01234688b37a48b29fee499529a500ccf5
parentaf7dec94c636769741e746090c9bd0590e3bbc22
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25903 from aznashwan/minor-docs-fixes

docs: minor fixes to main language reference page.

2 files changed, 7 insertions(+), 3 deletions(-)

doc/langref.html.in+1-2
......@@ -421,8 +421,7 @@
421421 {#code|unattached_doc-comment.zig#}
422422
423423 <p>
424 Doc comments can be interleaved with normal comments. Currently, when producing
425 the package documentation, normal comments are merged with doc comments.
424 Doc comments can be interleaved with normal comments, which are ignored.
426425 </p>
427426 {#header_close#}
428427 {#header_open|Top-Level Doc Comments#}
doc/langref/values.zig+6-1
......@@ -4,6 +4,11 @@ const std = @import("std");
44const os = std.os;
55const assert = std.debug.assert;
66
7// Custom error set definition:
8const ExampleErrorSet = error{
9 ExampleErrorVariant,
10};
11
712pub fn main() void {
813 // integers
914 const one_plus_one: i32 = 1 + 1;
......@@ -36,7 +41,7 @@ pub fn main() void {
3641 });
3742
3843 // error union
39 var number_or_error: anyerror!i32 = error.ArgNotFound;
44 var number_or_error: ExampleErrorSet!i32 = ExampleErrorSet.ExampleErrorVariant;
4045
4146 print("\nerror union 1\ntype: {}\nvalue: {!}\n", .{
4247 @TypeOf(number_or_error),