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

docs: minor fixes to main language reference page.
This commit is contained in:
Andrew Kelley 2025-11-21 19:56:15 -08:00 committed by GitHub
commit d828115dab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -421,8 +421,7 @@
{#code|unattached_doc-comment.zig#}
<p>
Doc comments can be interleaved with normal comments. Currently, when producing
the package documentation, normal comments are merged with doc comments.
Doc comments can be interleaved with normal comments, which are ignored.
</p>
{#header_close#}
{#header_open|Top-Level Doc Comments#}

View file

@ -4,6 +4,11 @@ const std = @import("std");
const os = std.os;
const assert = std.debug.assert;
// Custom error set definition:
const ExampleErrorSet = error{
ExampleErrorVariant,
};
pub fn main() void {
// integers
const one_plus_one: i32 = 1 + 1;
@ -36,7 +41,7 @@ pub fn main() void {
});
// error union
var number_or_error: anyerror!i32 = error.ArgNotFound;
var number_or_error: ExampleErrorSet!i32 = ExampleErrorSet.ExampleErrorVariant;
print("\nerror union 1\ntype: {}\nvalue: {!}\n", .{
@TypeOf(number_or_error),