- Most cost: a stale
target/fast/nikaia. Its build.rs had baked in winnow-grammar rev 9e23474f, while Cargo.toml pins 3b2dd3d6. Every grammar probe then failed with “multiple versions of winnow_grammar” or “Cannot find type E”. I spent about 8 turns treating that as my bug (bytes E, lock copies, a scratch project) before I found the bake-in. Second: the brief’s suggested lowering (bind the label in a block inside the guard) can’t work, and showing why took reading the backend’s codegen: the guard closure’s i is hygienic and capturing input conflicts with the borrow.
- Looked up: winnow-grammar codegen for
Guard, sequence steps and inlined value rules; hygiene of i; rt::guard; covered/covered_bytes; the existing helper-rule pattern (span/here/list in emit_grammar_body); emit_mentions; the Pattern variants; where the runtime rev is baked (build.rs). The brief could have said that the guard is a hygienic closure and input can’t be captured, and pointed at the helper rules as the precedent.
- Checks: old-binary probe (useful);
nikaia run probes after the fix (half wasted, broken by the stale rev); a scratch project without and with a copied lock (wasted, same cause); the guard set + clippy, pre-push, tests/compiler both settings, the yaml package (all needed). One build cycle was lost to a lowered file rewritten by the stale binary.
- One change: builder.md should say: before the first probe, check that
target/fast/nikaia embeds the Cargo.toml winnow-grammar rev (grep -c <rev> target/fast/nikaia); if not, touch crates/nikaia/build.rs and rebuild. “Multiple different versions of crate winnow_grammar” always means this, never your change.
This site is open source.
Improve this page.