ADR-167: The Shared Types Are the Language’s, and a Prelude Name Written With a Module Is Refused

Status: Superseded by ADR-313 — its D1 is D6 there (its test in D10), its D2 is D9 Date: September 20, 2026 Target Version: Nikaia 0.0.85 Related: ADR-154 D1 (the list), D3 (a type lives in its module), §5 (the list enforced in one direction), ADR-162 D3 (the test that watches the other), ADR-283 (the same argument for Bytes), ADR-281 D1 and D2 (which shape a shared value gets, and how a program makes one), ADR-281 D28 and D3, ADR-140 D5 (a module nothing describes yet is left alone), Part III C.1 and C.4, Part I 1.3 and 6.2, Part II 12.2

1. Context

ADR-162 D3 built the test that compares Part I 1.3’s list against what std keys bare, after three function names had drifted through unwatched. It watches functions, and a type walked straight past it: a type is keyed under its own name — SharedMut::access — rather than under nothing, so the filter never saw one.

Three had. Shared, SharedMut and Locked are written with no use — Part I 6.2 and Part II 12.2 write let counter = SharedMut(0) and always have — and they are named nowhere on the list that ends “and there are no others”.

Found by asking a different question, which is how it stayed hidden: not what does the list say but what happens to the correct spelling. Writing lock::SharedMut(0) — the shape every other std type wants — types as nothing, so Part II 12.3’s nesting refusal (NK2203, which ADR-281 D28 calls always) silently does not run, and the program reaches rustc, which says use of unresolved module or unlinked crate lock about a file nobody wrote. The same probe on io::println("x") says cannot find function println in module io.

2. Decisions

D1 — Shared, SharedMut and Locked are on Part I 1.3’s list.

They are the language’s, and the argument is ADR-283’s for Bytes, one type over: which shape a shared value gets is decided per value by the compiler (ADR-281 D1), and a type whose representation the compiler picks is not one a module owns. Part I 6.2 defines them in the language chapter, and Part II 12.3’s deadlock rule is the language’s rather than a library’s.

Nothing moves: they were already reachable with no import and every page already wrote them that way. What was missing was the line saying so, on the list whose whole value is that it is complete.

And the list gains the test it was missing. The comparison is made against the compiler’s own answer rather than the ledger’s, and that is the right side: what makes these three names a program writes with no import is that the checker knows them by name (check::HULLS, the list is_hull reads).

The three that are reachable and stay unlisted are the ones nobody writes — Entry, TaskHandle, Args. Each arrives as a result and none can be constructed, so no program names one, which is ADR-162’s own asymmetry: a listed name that is absent is one a program meets, an unlisted one that is reachable is one nobody does.

D2 — A name that needs no use, written with a std module in front of it, is refused (NK1163).

ADR-154 §5 enforced the list in the direction a name lives in a module — written without its prefix, NK1117. This is the same rule read the other way, and it is the direction a reader actually goes wrong in: every other std name wants its module, so reaching for io::println is the consistent guess.

Both halves are required, or it would be a guess rather than a claim: the module genuinely has no such name, and the bare one is a name std keys. That is what separates it from use std::db::postgres, a module nothing describes yet, which ADR-140 D5 leaves alone for C.4’s reason.

It cannot refuse a correct program, which is the test that reason sets: the program this refuses does not compile today under any reading, because the module has no such name and never did.

3. Consequences

4. What this does not decide

5. What is built

Both. crates/nikaia/tests/prelude.rs is six now: the two directions of the function list, the page read back, the four printing functions, the type direction against check::HULLS, and NK1163 with the pair of shapes it leaves alone.

This site is open source. Improve this page.