mirror of
https://github.com/horizon-rust/horizon-mixins.git
synced 2026-12-03 19:34:02 +07:00
[PR #2] [MERGED] Support noncancellable HEAD hooks on bodies containing macros #9
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
horizon-rust/horizon-mixins#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/horizon-rust/horizon-mixins/pull/2
Author: @rdbtCVS
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @levzzz5154
Base:
main← Head:fix/head-only-body-macros📝 Commits (1)
29a8f8fAllow preserved body macros for noncancellable HEAD hooks📊 Changes
9 files changed (+246 additions, -13 deletions)
View changed files
📝
Cargo.lock(+1 -0)📝
README.md(+3 -1)📝
crates/horizon-mixins-cli/Cargo.toml(+1 -0)📝
crates/horizon-mixins-cli/tests/cases/boundary.rs(+186 -0)📝
crates/horizon-mixins-cli/tests/integration.rs(+3 -3)📝
crates/horizon-mixins-core/src/plan.rs(+34 -2)📝
crates/horizon-mixins-core/src/state.rs(+1 -1)📝
docs/boundary-head-and-modules.md(+15 -5)📝
docs/mixin-api.md(+2 -1)📄 Description
Fixes #1.
Noncancellable HEAD-only hooks can now target functions containing opaque expression and statement macros such as
matches!. The planner preserves those macro tokens and uses the existing prepend-only transformation; no macro expansion or body-site analysis is introduced.Signature, type, pattern and item macros, unresolved cfg, attribute macros, and cancellable HEAD hooks retain their restrictions. RETURN/interior hooks and state constructor analysis still reject macro-containing bodies, including when combined with HEAD.
Regression coverage compiles two independently declared HEAD callbacks and verifies priority order, exactly-once execution, macro-generated early returns and tail values, local/argument destruction, original body AST preservation, immutable inputs, and unchanged staging mtimes. Negative cases cover unsupported macro contexts, invocation attributes, cancellation and mixed hooks. Documentation describes the supported boundary.
Validation:
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --locked— 67 integration tests passedpython3 tools/feasibility.pyValidation uses the compilation fixtures; the complete Horizon game was not built.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.