The V3 schema path (schema.rs) correctly uses an ExpandGuard RAII struct that auto-removes entries from the expanding set on drop. The V2 path uses manual enter()/leave() calls. If any ? early-return occurs between enter and leave, the expanding set leaks entries, causing false cycle detection on subsequent visits to the same schema.
This is a latent correctness bug. The V2 resolver (schema.rs:580-588) should be refactored to use the same RAII pattern as V3 (schema.rs:159).
The V3 schema path (
schema.rs) correctly uses anExpandGuardRAII struct that auto-removes entries from theexpandingset on drop. The V2 path uses manualenter()/leave()calls. If any?early-return occurs betweenenterandleave, theexpandingset leaks entries, causing false cycle detection on subsequent visits to the same schema.This is a latent correctness bug. The V2 resolver (
schema.rs:580-588) should be refactored to use the same RAII pattern as V3 (schema.rs:159).