Skip to content

Tag the two lifetime-domain rejection demos expect-error (#593) - #602

Merged
godofecht merged 1 commit into
mainfrom
doc-rejection-demos
Aug 19, 2026
Merged

godofecht merged 1 commit into
mainfrom
doc-rejection-demos

Conversation

@godofecht

@godofecht godofecht commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #593. unverified: 221 -> 219.

What they are

docs/language/lifetime-domains.md shows a callback-domain function calling malloc, then the diagnostic it produces. The diagnostic is the example. The checker was recording it as a failure.

Found by shape, not by reading prose

A flow block whose next fence is a text block beginning error: is the page asserting a diagnostic. That is a precise signal; searching the prose for words like "rejected" is not, and my first pass using that found nothing while missing both of these.

Three blocks in the corpus match that shape and fail on meaning.

Two are rejection demos

The compiler's message matches the documented text verbatim:

RT-safety violation: 'process' is in the `callback` lifetime domain,
which forbids allocation, but calls 'malloc'

lifetime domain violation: 'process' is in the `callback` domain but
calls 'reload_preset'

Checked by comparing the recorded detail against the page's own text fence, not by eye.

The third is deliberately left alone

docs/language/spans.md:119 fails with Undefined variable 'samples'. That is missing context, not the rejection the page demonstrates. Tagging it would hide an ordinary broken example behind expect-error, which the issue explicitly asks not to do:

Mark only those cases expect-error; do not use it to hide ordinary broken examples.

It needs same-page context instead, which is #584 (PR #601).

Verification

Check Result
check_doc_examples.py --check-ledger no new unverified, 221 → 219
pytest tests/unit/test_docs_blocks.py 48 passed

Both entries are now expected-error at stage types, carrying the intended diagnostic, which is what the acceptance criteria asked for.

@godofecht
godofecht force-pushed the doc-rejection-demos branch from 652920a to d08bf88 Compare August 19, 2026 22:14
docs/language/lifetime-domains.md shows a callback-domain function calling
malloc, then the diagnostic it produces. The diagnostic is the point of the
example, and the checker was recording it as a failure.

Found by shape rather than by reading prose: a flow block whose next fence is
a text block beginning "error:" is the page asserting a diagnostic. Three
blocks match that shape and fail on meaning. Two are these; the compiler's
message matches the documented text verbatim:

    RT-safety violation: 'process' is in the `callback` lifetime domain,
    which forbids allocation, but calls 'malloc'

    lifetime domain violation: 'process' is in the `callback` domain but
    calls 'reload_preset'

The third, docs/language/spans.md:119, is deliberately left alone. It fails
with "Undefined variable 'samples'", which is missing context rather than the
rejection the page demonstrates. Tagging it would hide an ordinary broken
example behind expect-error, which is what the issue asks not to do. It needs
same-page context instead (#584).

Closes #593

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@godofecht
godofecht force-pushed the doc-rejection-demos branch from d08bf88 to 9a2e13f Compare August 19, 2026 23:05
@godofecht
godofecht merged commit 3430209 into main Aug 19, 2026
21 checks passed
@godofecht
godofecht deleted the doc-rejection-demos branch August 19, 2026 23:08
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.

Intentional safety/lifetime rejection examples should be expect-error, not unverified

1 participant