Stop the crate root counting the types that hold something, and anchor the command that counts the block - #435
Merged
Conversation
…r the command that counts the block (#434) The paragraph in `src/lib.rs` about the compile-time thread assertions said "One of them holds something now" and named `measurement::Measurement`. That was a count over the assertion block, and the block held five assertion lines on 2026-08-26 when the sentence landed. It holds 145 at `f38bf7b101550664e06b9b8ee72c4dff5ad8e186`, and nine of the types asserted there are written with a borrowed parameter, so each of them holds a reference in exactly the sense the sentence gives for `Measurement`. The count is deleted rather than corrected, for the reason the next paragraph in the same comment already gives about a count in this file: the next landing moves it again, and nothing here reads a number written into a doc comment. `Measurement` stays as the example and stops being named as the whole set. Nine is recorded as a floor rather than a population, because a type does not need a lifetime to hold a field, and counting the rest needs a reading of every declaration. The command that paragraph hands a reader to derive the list counted the line that hands it over. `git grep -c 'any_thread::<' -- src/lib.rs` matched line 80 of the doc comment as well as the assertions, so it answered 146 against 145, and it answered 15 against 14 on 2026-08-27, the day it arrived. It has been one too many on every reading it has ever had, which is a derivation written to replace a stale count and then never run against the block. It carries `^ ` now: an assertion is indented inside the block and the line quoting the command is not, so the anchor keeps that line out of its own answer. What failure it prevents: a reader sizing what a green build proves about thread safety here. The closing sentence of the paragraph says an assertion over a type holding nothing cannot fail on the bytes in this tree, and it is there so that the day the type holds something is the day the compiler starts judging it. With "one of them" above it, that reads as a block of empty names waiting for a day that has not come. The day has come for at least nine of them, and that half is now stated where the sentence is. What was wrong, and how it was found: two counts in one paragraph, read against the block they are about. Nothing in this tree would have said so - `doc-paths` reads `git ls-files '*.md'` and never opens a Rust file. No assertion, type or field changes. What the compiler judges is what it judged. `cargo build --locked --all-targets` and `cargo test --locked` are green at this commit, and `.github/format/format.sh check`, `.github/lint/lint.sh check`, `.github/doc-paths/doc-paths.sh check` and `.github/invariants/invariants.sh check` each exit 0. `.github/shell-analysis/shell-analysis.sh` was NOT run here: `shellcheck` is not on this machine and the script says so rather than passing. The gate runs that leg. Closes #434 Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue this belongs to
Closes #434
What changed
The crate root's paragraph about the compile-time thread assertions stops counting
the types that hold something, and the command it hands a reader to derive the list
is anchored so that it counts the block rather than itself.
The paragraph said "One of them holds something now" and named
measurement::Measurement.Measurementstays as the example; what goes is thecount. In its place the comment records what it said, why the number went stale,
and that nine of the types asserted below carry a borrowed parameter and therefore
hold a reference in the same sense - written as a floor rather than as a
population, because a type does not need a lifetime to hold a field.
The command gained a
^anchor. An assertion is indented inside the block andthe doc-comment line quoting the command is not, so the anchor is what keeps that
line out of its own answer.
What failure it prevents
A reader sizing what a green build proves about thread safety here. The closing
sentence of the paragraph says an assertion over a type holding nothing cannot fail
on the bytes in this tree, and it is there so that the day the type holds something
is the day the compiler starts judging it. With "one of them" standing above it,
that reads as a block of empty names waiting for a day that has not come. The day
has come for at least nine of them.
This is a correction rather than a new guard, and both halves had already happened.
The count was right when it landed on 2026-08-26 over five assertions and has been
wrong since the block grew. The command was off by one on the day it arrived.
How it was found: reading the paragraph against the block under it. Nothing in this
tree would have said so.
doc-pathsreads Markdown and never opens a Rust file, so a count in a doc commentis read by nothing here.
Evidence
All readings at the commit pushed,
f4a03c540408c4180e742ce02d38af8c466c7f80,except where a historical commit is named.
The block, and what the two forms of the command answer against it:
145 is the block. The unanchored form still answers 146 at this commit, because the
doc-comment line quoting the anchored command still carries the substring, which is
the whole reason the anchor is there.
Where the count came from, and what the block was then:
Where the command came from, and that it was already one too many:
The nine the comment now names, and three of the eight that are not
Measurement:The diff is one file and one comment block:
The runs, at this commit.
cargo build --locked --all-targetsandcargo test --lockedboth finish without error; the suite's own totals:Ten result lines, all reading
ok. A run that collected nothing would print aresult line too, which is what
.github/test/test.shrefuses on the gate; that legwas not run here.
What this does not cover
any_threadline is added or removedand no declaration is touched, so what the compiler judges is what it judged
before this change. The diff is a doc comment.
written into the comment as a floor. Counting the rest needs a reading of every
declaration, and a number from such a reading typed into this file is the thing
the issue is about.
comment against what it counts, and nothing here builds one.
doc-pathsreadsgit ls-files '*.md'and widening it to Rust is not asked for here..github/shell-analysis/shell-analysis.shwas NOT run.shellcheckis not onthis machine, and the script says so rather than passing. No shell file is touched
by this change and the gate runs that leg.
here. Those run on the gate.
they read correctly against the tree at this commit.
Who has read it
Nobody other than the author. There is no second reader on this board tonight, and
the evidence above stands in place of one rather than the question being left open.