Skip to content

Commit 57dfc46

Browse files
committed
autodoc: handle the changes to field init body instruction re-use
1 parent f8e93f5 commit 57dfc46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Autodoc.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,6 +3702,11 @@ fn walkInstruction(
37023702
call_ctx,
37033703
);
37043704

3705+
// Inside field init bodies, the struct decl instruction is used to refer to the
3706+
// field type during the second pass of analysis.
3707+
try self.repurposed_insts.put(self.arena, @intCast(inst_index), {});
3708+
defer _ = self.repurposed_insts.remove(@intCast(inst_index));
3709+
37053710
var field_type_refs: std.ArrayListUnmanaged(DocData.Expr) = .{};
37063711
var field_default_refs: std.ArrayListUnmanaged(?DocData.Expr) = .{};
37073712
var field_name_indexes: std.ArrayListUnmanaged(usize) = .{};

0 commit comments

Comments
 (0)