WhatsNew: print is the canonical output + two bug fixes + CLI diagnostic polish

User-facing entry covering the rpe.1 milestone close + the two
upstream bugs fixed in this session + the cli-diag-human P2 todo.
Five separate iters folded into one done-state note (per the
WhatsNew convention of one entry per done-state notification, not
one entry per iter).
This commit is contained in:
2026-05-14 02:29:08 +02:00
parent a95961617f
commit c17bc70487
+10
View File
@@ -144,3 +144,13 @@ Two internal cleanups while you were away. Compiler documentation builds without
## 2026-05-14 — Compiler now builds clean under `cargo clippy`
Sixty-one linter warnings across the whole compiler workspace are gone — the project now builds clean under `cargo clippy --workspace --all-targets`. Most were documentation: multi-line comments that the linter misread as bullet lists, and orphan doc-blocks left over from the recent test relocations. A handful were idiomatic refactors (`.expect_err` instead of `.err().expect()`, dropped redundant closures, collapsed nested pattern matches, two manual `Default` impls replaced by `#[derive(Default)]`). Three places kept the original code with an inline `#[allow]` and a one-line reason, where the linter's suggestion would have lost meaning. All tests stay green, the documentation build stays warning-free, and all three benchmark scripts pass at the existing baselines — confirming the sweep touched no semantics.
## 2026-05-14 — Print is now the only way (and two related bug fixes)
The per-type print operators are retired. `print` (polymorphic, ships in the prelude) is now the only way to print a value of a primitive type — the older `print_int` / `print_bool` / `print_float` operators have been removed from the compiler, and every example program in the corpus is migrated. The byte-channel primitive that emits a string directly remains as the one surviving direct-output operation; everything else routes through `print` via the `Show` class.
Two compiler bugs surfaced during the migration and were fixed before the retirement landed. First, calling `print` with a class-method-call expression as its argument (for example `print (eq 1 2)`) crashed during code generation — the compiler was mis-aligned by one slot when resolving the class constraint, and the inner `eq` was being mis-rewritten as a `show` call. The fix straightens the slot accounting at every polymorphic free-function call site. Second, `print` was leaking one heap-allocated string per call under reference-counting mode — the let-binder for the rendered text inside `print`'s body was not being recognised as trackable, so its scope-close drop never fired. The fix annotates the prelude `Show` method correctly and stops a type-rewriting helper from silently stripping mode metadata during substitution.
Plus one CLI polish item that the field test from the last cycle had flagged: `ail check` and eight other subcommands now show the same `[error-code]` prefix in their text output that the JSON mode has always shown — so a failed import, a module cycle, a schema mismatch, all arrive on the human path with the same diagnostic code that scripted consumers were already using. Before this fix the text path used a different formatter that dropped the code; now both paths share one source.
All tests green. Compiler builds clean under both the linter and the documentation builder. Benchmark scripts all pass at the existing baselines.