const WipDecls = struct
const WipDecls = struct { astgen: *AstGen, slice: Scratch.Slice, index: u32, fn init(scratch: *Scratch, decls_len: u32) Allocator.Error!WipDecls { return .{ .astgen = scratch.astgen, .slice = try scratch.addSlice(decls_len), .index = 0, }; } fn finish(wip: *WipDecls) void { assert(wip.index == wip.slice.len); wip.* = undefined; } fn nextDecl(wip: *WipDecls, decl_inst: Zir.Inst.Index) void { wip.slice.get(wip.astgen)[wip.index] = @backingInt(decl_inst); wip.index += 1; } }