Skip to content

Every engine facade's view accessor states from self; D22 cells for the D148 facades - #2573

Merged
ehartford merged 1 commit into
mainfrom
facade-origins
Oct 23, 2026
Merged

ehartford merged 1 commit into
mainfrom
facade-origins

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Every D148 engine facade's view accessor now states from self (§21.1 rule 6), as BTreeMap.get does since #2572.

The hole. OrderedMap, OrderedSet, UnorderedMap, UnorderedSet, Deque, PriorityQueue, BinaryHeap, SortedList, Trie and HashIndex return views through the engine's slot pointer; no inference roots such a view at self, so let view = m.get(1).unwrap(); m.remove(1); print(*view) compiled for every one of them (twelve probes, twelve accepted on main).

The fix. Each accessor (get, first, last, front, back, peek) declares from self; the clause mechanics landed in #2572 (the origin reaches callers through the signature; the judge accepts the clause for a body that reads through a raw pointer). Twelve D22 cells test/compile_errors/err_d22_<facade>_<accessor>_origin_after_mutation.w pin the rejection; a view used before the mutation still compiles and runs.

No compiler change; std only.

…der the view is refused

The D148 facades (OrderedMap, OrderedSet, UnorderedMap, UnorderedSet,
Deque, PriorityQueue, BinaryHeap, SortedList, Trie, HashIndex) return a
view through the engine's slot pointer exactly as BTreeMap.get did before
#2572: no inference roots it at `self`, so `let view = m.get(1).unwrap();
m.remove(1); print(*view)` compiled for every one of them (twelve probes,
twelve accepted). Each accessor (`get`, `first`, `last`, `front`, `back`,
`peek`) now declares `from self` under §21.1 rule 6, as BTreeMap.get does,
and the D22 cells err_d22_<facade>_<accessor>_origin_after_mutation.w pin
the rejection; a view used before the mutation still compiles.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on e3e7f02 (seed nightly-20261020-local-3, 349 s wall; logs out/battery/ in the worktree). Gate green.

@ehartford
ehartford marked this pull request as ready for review October 23, 2026 06:16
@ehartford
ehartford merged commit 8fda443 into main Oct 23, 2026
@ehartford
ehartford deleted the facade-origins branch October 23, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant