compiler/.claude/rules/rust-port.md MARKDOWN 24 lines View on github.com → Search inside
1---2description: Conventions for Rust port code in compiler/crates3globs:4  - compiler/crates/**/*.rs5  - compiler/crates/**/Cargo.toml6---78When working on Rust code in `compiler/crates/`:910- Follow patterns from `compiler/docs/rust-port/rust-port-architecture.md`11- Use arenas + copyable IDs instead of shared references: `IdentifierId`, `ScopeId`, `FunctionId`, `TypeId`12- Pass `env: &mut Environment` separately from `func: &mut HirFunction`13- Use two-phase collect/apply when you can't mutate through stored references14- Run `bash compiler/scripts/test-babel-ast.sh` to test AST round-tripping15- Use `/port-pass <name>` when porting a new compiler pass16- Use `/compiler-verify` before committing to run both Rust and TS tests17- Keep Rust code structurally close to the TypeScript (~85-95% correspondence)1819Before declaring work complete on a plan doc:20- Re-read the original user prompt to ensure all requested steps are done21- Check the plan doc for any "Remaining Work" items22- Verify test-babel-ast.sh passes with the expected fixture count23- Update the plan doc's status section

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.