Skip to content

Stop dropping an enum at any enum already being dropped around it - #356

Open
coord-e wants to merge 1 commit into
mainfrom
claude/gifted-bohr-f2nxpn
Open

coord-e wants to merge 1 commit into
mainfrom
claude/gifted-bohr-f2nxpn

Conversation

@coord-e

@coord-e coord-e commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Fixes #178. Also fixes #341.

Env::dropping_formula_for_term only cut recursion at a variant field that is directly a pointer to an enum with the same symbol. That caused two problems:

This PR passes a stack of the sorts of the enums whose drop formula is being built. An enum is skipped only when its sort is already on that stack. The direct Box<Self> case is skipped the same way it was before, now by the guard. Every other path back to an enclosing enum is cut too, and a different instantiation is recursed into. Skipping still only leaves a prophecy unresolved, so it stays sound, as the existing skip was.

This overlaps with #342, which fixes #341 by comparing the pointee's sort. It doesn't help the overflow cases, because there the field that leads back is not a pointer to the enum being dropped.

Tests


Generated by Claude Code

dropping_formula_for_term cut recursion only at a variant field that is
directly a pointer to an enum with the same symbol. A recursive enum
reached any other way recursed forever and overflowed the stack: through
a tuple field (#178), through another enum such as
`Node(i64, Option<Box<Node>>)`, or through a mutually recursive enum.
The symbol-only check also treated a pointer to another instantiation of
the same generic enum as recursive, leaving the `&mut` in
`Option<&mut Option<i64>>` unresolved (#341).

Track the sorts of the enums whose drop formula is being built, and skip
an enum only when its sort is already among them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hw71PvaCsVX6Gv13CKahEf
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T21:44:50.211258Z ccef9c8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment