[GH-ISSUE #21] RETURN injection into durability_loss is rejected due to local macro resolution #7

Open
opened 2026-11-02 15:32:22 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @sofia-gros on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon-mixins/issues/21

A RETURN injection into Game::durability_loss is rejected during planning, even when the helper simply returns the original value.

Environment:

  • Horizon: 3a264943c7a3a3ed02e6ee608443f558d98f208f
  • Mixins: ddd9700b21

Injection target:
horizon_client::game::enchant_effects::Game<'_>::durability_loss

The injection kind is RETURN, with value: u32 bound to $value. The helper is:
fn unchanged(value: u32) -> u32 { value }

Planning fails with:
E_UNSUPPORTED_MACRO: macro identity is ambiguous; use an unshadowed absolute standard path

The target function calls world_stations! and world_items!.

I also tested MODIFY_EXPRESSION_VALUE around the durability_loss call inside Game::wear. Its plan succeeds and targets the result before event emission. However, creature and dispenser code also call durability_loss directly. Similar probes at those call sites are rejected because the enclosing functions contain closures. This does not rule out every alternative, but the tested approach does not cover all these paths.

Could these local macros be supported when their identities and control flow can be verified safely? Alternatively, is there a supported way to modify the result across these callers while preserving event order?

I’m not asking to bypass or weaken the safety checks.

Originally created by @sofia-gros on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon-mixins/issues/21 A RETURN injection into Game::durability_loss is rejected during planning, even when the helper simply returns the original value. Environment: - Horizon: 3a264943c7a3a3ed02e6ee608443f558d98f208f - Mixins: ddd9700b21997c95d95ac6ee5ecafe3830cf622a Injection target: horizon_client::game::enchant_effects::Game<'_>::durability_loss The injection kind is RETURN, with value: u32 bound to $value. The helper is: fn unchanged(value: u32) -> u32 { value } Planning fails with: E_UNSUPPORTED_MACRO: macro identity is ambiguous; use an unshadowed absolute standard path The [target function](https://github.com/horizon-rust/horizon/blob/3a264943c7a3a3ed02e6ee608443f558d98f208f/crates/horizon-client/src/game/enchant_effects.rs) calls world_stations! and world_items!. I also tested MODIFY_EXPRESSION_VALUE around the durability_loss call inside Game::wear. Its plan succeeds and targets the result before event emission. However, creature and dispenser code also call durability_loss directly. Similar probes at those call sites are rejected because the enclosing functions contain closures. This does not rule out every alternative, but the tested approach does not cover all these paths. Could these local macros be supported when their identities and control flow can be verified safely? Alternatively, is there a supported way to modify the result across these callers while preserving event order? I’m not asking to bypass or weaken the safety checks.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-mixins#7
No description provided.