Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions changelog.d/10804-stale-denial-issue-pointer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
**fix(codegen): point the module-global `Ptr<Shape>` denial at its real issue.**
`MODULE_GLOBAL_ISSUE` in `expr/slot_rep.rs` — the issue number the optimiser
report prints when a module-level binding is denied a canonical slot — cited
**#7109**. That is a different mechanism: #7109 is the module-init /
program-entry *context* gate, which `MODULE_INIT_CONTEXT` in the same file
still cites correctly. #7109 is closed, and so is #10774, which lifted that
gate.

So every reader who followed the denial's own pointer landed on a closed issue
about something else, and could reasonably conclude the module-global class was
already handled. That is not hypothetical: one optimisation pass recorded
module-global storage as "less important" on exactly that reading, and a
separate campaign spent a day repeating "#7109 is the blocker" on inherited
belief before checking the issue state.

Now points at **#10803** (`Ptr<Shape>` is denied to three storage classes:
module globals, function parameters, and locals escaping into a module global),
with a comment recording why the old pointer was wrong so the correction is not
silently reverted.

Deliberately unchanged: `MODULE_INIT_CONTEXT`'s `#7109`, which is accurate to
that rule's subject, and the `#7109` fixture string in `opt_report/render.rs`'s
test helper. Only the live user-facing pointer for the module-global storage
class moved. `the_context_gate_is_reported_when_every_value_rule_passed`
asserts the `MODULE_INIT_CONTEXT` pointer and still passes unchanged, which is
what confirms the two were separable.

Found by cross-session review while handing the module-global lane to another
campaign; the denial classes it names are that campaign's #10803.
10 changes: 9 additions & 1 deletion crates/perry-codegen/src/expr/slot_rep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,15 @@ pub(crate) fn deny_canonical_i32(ctx: &FnCtx<'_>, id: u32, name: &str, denial: C
}

/// Tracking issue for "a module-level binding can never take a canonical slot".
const MODULE_GLOBAL_ISSUE: &str = "#7109";
///
/// This pointed at #7109 until #10803. #7109 is a *different* mechanism — the
/// module-init / program-entry context gate, which `MODULE_INIT_CONTEXT` below
/// still cites correctly — and it is closed, as is #10774 which lifted that
/// gate. A reader who followed this denial's own pointer therefore landed on a
/// closed issue about something else and could reasonably conclude the
/// module-global class was already handled; that is how one optimisation pass
/// came to record module-global storage as "less important".
const MODULE_GLOBAL_ISSUE: &str = "#10803";
/// Tracking issue for the index-use / i32-bound precondition.
const NOT_BOUNDED_ISSUE: &str = "#7123";
/// Tracking issue for the profitability refusal — the one denial in this list
Expand Down
Loading