Centralize Model type lowering logic in thrust-macros to FormulaFnTypeLowering - #107
Conversation
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR refactors thrust-macros to centralize formula-function type lowering and Model-predicate generation into a new FormulaFnTypeLowering helper, replacing previously duplicated logic scattered across macro expansions.
Changes:
- Introduces
FormulaFnTypeLoweringto handle parameter/return type lowering and generation ofModel/PartialEqwhere-predicates. - Migrates
#[predicate],#[requires]/#[ensures], and invariant-related expansions to use the shared lowering helper. - Removes the old lowering/predicate helpers from
thrust-macros/src/lib.rsin favor of the new module.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| thrust-macros/src/spec.rs | Switches requires/ensures/predicate expansion to use centralized type lowering + predicate generation. |
| thrust-macros/src/lib.rs | Registers new module and removes old helper functions that were moved into the new lowering helper. |
| thrust-macros/src/invariant.rs | Uses centralized lowering/predicate generation when expanding invariants. |
| thrust-macros/src/invariant_context.rs | Uses centralized predicate generation when threading generic context into invariants. |
| thrust-macros/src/formula_fn_type_lowering.rs | New shared implementation for parameter/return lowering and Model where-predicate generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
extracted from #104