Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

setExtra

Private Function
std.zig.ErrorBundle.Wip.setExtra
fn setExtra(wip: *Wip, index: usize, extra: anytype) void

Params

  • wip: *Wip
  • index: usize
  • extra

File

zig/ErrorBundle.zig:748
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
    fn setExtra(wip: *Wip, index: usize, extra: anytype) void {
        const extra_info = @typeInfo(@TypeOf(extra)).@"struct";
        const field_names = extra_info.field_names;
        const field_types = extra_info.field_types;
        var i = index;
        inline for (field_names, field_types) |field_name, field_type| {
            wip.extra.items[i] = switch (field_type) {
                u32 => @field(extra, field_name),
                MessageIndex => @backingInt(@field(extra, field_name)),
                SourceLocationIndex => @backingInt(@field(extra, field_name)),
                else => @compileError("bad field type"),
            };
            i += 1;
        }
    }