NEO.K / MSSP 開源專案考古020-rust-must-use
專案Rust Result and the unused_must_use lint
授權Apache-2.0 OR MIT
檢視版本measured at run time
日期2026-08-20
來源upstream ↗

020 — Rust Result#[must_use]:取值被強制,丟棄沒有

上游是 Rust 的 Resultunused_must_use lint, 用真的跑 rustc 量出來(Apache-2.0 / MIT 雙授權)。版本由執行時量出來。 這一則需要本機有 rust 工具鏈;沒有的時候它拒絕回報,不猜。

node src/main.mjs            # 五種寫法,每一列都是真的跑過的 cargo build
node src/main.mjs --strict   # 這個部署的 lint 設定有缺口就 exit 1
node src/island_test.mjs     # 39 項檢查,數字由它自己印

為什麼選它

同日的範例 020 主張宣告你能觀察什麼,不要宣告你是什麼,理由是能力宣告可以被測試

Result<T, E> 就是那句話變成結構:它是一份**「我可能是錯的」的能力宣告**,而編譯器在值被使用的地方強制執行它。這是這 20 則裡唯一一個上游把宣告變成編譯期義務的例子——所以它適合當最後一則。

原專案的結構地圖

    route                compiles   must_use warning   error
    bare call            yes        yes                -
    let _ = ...          yes        -                  -
    .unwrap_or(0)        yes        -                  -
    let v: i32 = ...     NO         -                  E0308
    match { Ok, Err }    yes        -                  -

對照組是最後一列。 把處理寫出來,編過、沒有警告。沒有它,「let _ = ... 編過而且乾淨」跟「所有寫法都編過而且乾淨」一模一樣,不構成任何主張。

界線是兩句話:

而最有意思的一列在下面:

  and with the consumer's own deny(unused_must_use):
    bare call            NO         as an ERROR        -
    let _ = ...          yes        -                  -

let _ = ... 在語言提供的最嚴設定底下照樣編過,而且什麼都沒說。 也就是說:剩下那個訊號有多強,是消費者的設定決定的——那正是改良點 16(宣告的方向由消費它的政策決定)出現在一個型別系統裡面。

儀器自己錯過,而且我對它的第二個診斷是編的

這一則的第一版每一個編得過的寫法都報「沒有警告」。原因:cargo 的診斷寫在 stderr,而且警告時 exit 0execFileSync 的回傳值只有 stdout。改用 spawnSync 就對了。

然後我在旁邊寫了第二個原因,而它不是真的。 我寫「共用一個 package 名 + 共用 target 目錄會讓 cargo 用快取單元回答,於是後面的探針全都安靜」。把那個缺陷加回去的變異保持綠色——這一輪第一次有變異沒有變紅。去量才知道為什麼:

  PASS  building the same directory twice really does hit the cache the second time - first Compiling, second Finished
  PASS  and the cached build REPLAYS the warning rather than going quiet

快取命中的建置會把診斷重播出來。 那個危害不存在。第 2 節現在量它,而不是斷言它。

(順帶量到第三件事:第一版的快取探針每次都重寫 main.rs,所以檔案 mtime 一直變、cargo 永遠重編,那支探針從來沒看過一次快取命中。要觀察快取,就不能碰來源。)

MSSP 重切

集合 裡面是什麼
FMS 每種寫法宣告什麼、量到什麼,儀器自己的失敗模式,以及 units 對照
SCL 這個部署的 lint 設定,以及那個設定伸不到哪裡
SMS 編譯器探針——每一列都是真的跑過的 cargo build
TMS 一種寫法一個檔——各自帶著自己的片段與它對編譯器的宣稱,而且 import 任何東西都沒有
DMS compiles 跟警告欄一起印,不單獨出現

重切加的是範例 020 的挑戰,把 rustc 當 oracle:每種寫法宣告「編譯器會不會強制我處理」,然後去問編譯器。第 6 節逐條驗,加一個鑽孔——一個宣稱被強制、實際沒有的寫法必須被抓到。

什麼不適合拆

#[must_use] 有在做事。 五列裡只有 bare call 那一列會因為它移動,而那正是它的用途。

let _ = ... 也不該被拿掉。 它是「我是故意忽略的」這句話的寫法,而那句話有時候是對的。缺陷不在任何一邊,在於故意忽略跟疏忽忽略最後長得一樣,而語言沒有留下判別它們的地方。

這次沒有解決什麼

這一則只量了一個型別、一個語言、一套工具鏈(rustc 1.96)。它示範了那個界線,沒有證明任何關於型別系統的一般命題。

沒有比較的: checked exceptions、OptionEither。每一個都需要新的探針,不是重讀既有輸出。

沒有處理的: clippy 有沒有辦法把 let _ = 也擋下來,以及一個團隊用 review 把它擋掉算不算「機械化」。這一則量的是編譯器做什麼,不是專案能在它周圍安排什麼。


這是這一輪的最後一則考古。 20 個範例、20 個考古之後,照 Neo 定的路線,接下來是真實市場應用。

重切原始碼

FMS

FMS/architecture.json
{
  "name": "020-rust-must-use",
  "upstream": "Rust: Result, #[must_use], and the unused_must_use lint, measured by running rustc",
  "what_is_being_examined": "Five ways a caller can meet a Result, and which of them the compiler refuses.",

  "the_finding": "Extraction is forced and discarding is not. Using the T without naming the Err case is a type error (E0308), so no lint setting is needed. Dropping the whole value is a warning, and discarding it explicitly with `let _ =` is not even that — it compiles clean under deny(unused_must_use), which is the loudest setting the language offers.",

  "why_it_belongs_beside_example_020": "Example 020 argues that a unit should declare its CAPACITY rather than its state, because a capacity claim is testable. Rust's type system is that argument made structural: Result<T, E> is a declared capacity to be wrong, and the compiler enforces it exactly where the value is used. What it does not do is stop a consumer from refusing to look — which is 改良點 16 appearing inside a type system, since the strength of the remaining signal is the consumer's lint setting.",

  "the_control": "`match { Ok, Err }` — handling written out, compiles clean, no warning. Without it, `let _ = ...` compiling clean would be consistent with every route compiling clean and would be evidence of nothing.",

  "routes": {
    "bare call":         {"claims_compiler_forces_handling": false, "measured": "compiles, must-use warning"},
    "let _ = ...":       {"claims_compiler_forces_handling": false, "measured": "compiles, no warning, and still compiles under deny"},
    ".unwrap_or(0)":     {"claims_compiler_forces_handling": false, "measured": "compiles clean - Err named by method call"},
    "let v: i32 = ...":  {"claims_compiler_forces_handling": true,  "measured": "does NOT compile, E0308"},
    "match { Ok, Err }": {"claims_compiler_forces_handling": false, "measured": "the control - compiles clean"}
  },

  "the_instrument_was_wrong_first": "One defect, fixed, and covered by section 2 of the island test: cargo writes diagnostics to stderr and exits 0, so reading only the return value of execFileSync reported 'no warning' for every route that compiled. I also wrote down a SECOND cause - that a shared package name under a shared target directory would let a cached unit answer silently - and it is not real. The mutation reinstating it stayed green, and measuring it directly showed why: a no-op `Finished` build replays the cached diagnostics. Section 2 measures that instead. It is the first time in this run that a green mutation refuted a defect I had claimed rather than confirming one.",

  "sets": {
    "FMS": "this file: what each route claims and what was measured, the instrument's own failure modes, and the units map",
    "SCL": "the deployment's lint setting, and what that setting cannot reach",
    "SMS": "the compiler probes - each row is a cargo build that really ran",
    "TMS": "one file per route - each carries its snippet and what it claims about the compiler, and imports nothing",
    "DMS": "compiles and the warning column printed together, never one alone"
  },

  "units": {"TMS/routes": ["bare_call.mjs", "direct_assign.mjs", "explicit_discard.mjs", "match_arm.mjs", "unwrap.mjs"]},

  "non_goals": [
    "Establishing anything about type systems in general. This is one type, in one language, on one toolchain - rustc 1.96 - and the claim is demonstrated there rather than proved.",
    "Judging whether let _ = should be reachable by a lint. Clippy has opinions and teams have review; this measures what the compiler does, not what a project can arrange around it.",
    "Comparing with checked exceptions, Option, or Either. Each would need new probes rather than a re-reading of these."
  ]
}

SCL

SCL/policy.json
{
  "deployment": "release-pipeline",
  "lint_setting": "deny(unused_must_use)",
  "an_explicitly_discarded_result_is": "not reachable by any lint setting",
  "why": "This pipeline turns the must-use warning into an error, which is the strongest setting the language offers. It is written down here because the measurement shows what that setting does NOT cover, and a policy that implies coverage it does not have is worse than one that names its gap.",
  "what_this_cannot_reach": "let _ = fallible(). It compiles clean under deny(unused_must_use) - the loudest available setting does not stop the explicit discard.",
  "not_a_general_rule": "A codebase where let _ is banned by review, or by a clippy lint the team enables, closes it socially rather than mechanically. SCL is where the position lives."
}

SMS

SMS/compiler.mjs
// Probes that run the real compiler. Nothing here is simulated — every row in
// the report is a `cargo build` that actually happened.
//
// One thing about the instrument got it wrong the first time and is worth
// keeping in the source: cargo writes diagnostics to STDERR and exits 0 on a
// warning, and the return value of execFileSync is stdout only — so the first
// version of this file reported "no warning" for every route that compiled.
// spawnSync hands back both streams whatever the exit status.
//
// I also wrote down a second cause — that a shared package name under a shared
// target directory would let a cached unit answer silently — and it is NOT
// real. A mutation reinstating it stayed green, and measuring it directly
// showed why: a no-op `Finished` build REPLAYS the cached diagnostics. Section
// 2 of the island test measures that rather than asserting it. Each probe still
// gets its own package name, which costs nothing and keeps the probes
// independent of that behaviour either way.
import { spawnSync } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

const ROOT = fs.mkdtempSync(path.join(os.tmpdir(), "mssp-020-"));
const SHARED_TARGET = path.join(ROOT, "target");
let crateCounter = 0;

export const PRELUDE = 'fn fallible() -> Result<i32, String> { Err("broke".into()) }';

export function versions() {
  const rustc = spawnSync("rustc", ["--version"], { encoding: "utf8" });
  const cargo = spawnSync("cargo", ["--version"], { encoding: "utf8" });
  return `${(rustc.stdout ?? "").trim()} | ${(cargo.stdout ?? "").trim()}`;
}

export function available() {
  const probe = spawnSync("cargo", ["--version"], { encoding: "utf8" });
  return probe.status === 0;
}

// Build one crate and report what the compiler said. `deny` puts the lint
// setting in the CONSUMER's crate, which is where it lives in real code.
export function build(body, { deny = false } = {}) {
  crateCounter += 1;
  const dir = fs.mkdtempSync(path.join(ROOT, "crate-"));
  return buildIn(dir, body, { deny, name: `probe${crateCounter}` });
}

// Split out so the island test can write a crate once and then build it TWICE,
// which is the only way to see what a cached build reports. Writing the source
// again gives it a new mtime and forces a recompile — which is what the first
// version of this probe did, so it never saw a cache hit at all.
export function buildIn(dir, body, { deny = false, name = "probe" } = {}) {
  fs.mkdirSync(path.join(dir, "src"), { recursive: true });
  fs.writeFileSync(path.join(dir, "Cargo.toml"),
    `[package]\nname = "${name}"\nversion = "0.1.0"\nedition = "2021"\n`);
  fs.writeFileSync(path.join(dir, "src", "main.rs"),
    `${deny ? "#![deny(unused_must_use)]\n" : ""}${PRELUDE}\nfn main() {\n${body}\n}\n`);
  return rebuild(dir);
}

// Run cargo against a crate already on disk, touching nothing.
export function rebuild(dir) {
  const result = spawnSync("cargo", ["build", "--target-dir", SHARED_TARGET],
    { cwd: dir, encoding: "utf8" });
  const text = `${result.stdout ?? ""}${result.stderr ?? ""}`;
  return {
    compiles: result.status === 0,
    exitStatus: result.status,
    recompiled: /Compiling/.test(text),
    mustUseWarning: /warning: unused `Result` that must be used/.test(text),
    denied: /error: unused `Result` that must be used/.test(text),
    errorCode: (text.match(/error\[([A-Z0-9]+)\]/) ?? [])[1] ?? null,
  };
}

// The challenge: a route claims whether the compiler FORCES the Err case to be
// named. The compiler answers. This is example 020's shape with rustc as the
// oracle — and, as there, the claim is checked by running it.
export function challenge(route) {
  const plain = build(route.BODY);
  const strict = build(route.BODY, { deny: true });
  const forced = plain.compiles === false && plain.errorCode !== null;
  return {
    route: route.NAME,
    claimed: route.CLAIMS_COMPILER_FORCES_HANDLING,
    plain,
    strict,
    forced,
    passed: forced === route.CLAIMS_COMPILER_FORCES_HANDLING,
  };
}

export function cleanup() {
  fs.rmSync(ROOT, { recursive: true, force: true });
}

TMS

TMS/routes/bare_call.mjs
// Call it and let the Result fall on the floor.
export const NAME = "bare call";
export const BODY = "    fallible();";
export const CLAIMS_COMPILER_FORCES_HANDLING = false;
export const HOW = "the value is dropped; #[must_use] makes it noisy, not impossible";
TMS/routes/direct_assign.mjs
// Try to use the T without acknowledging the E at all.
export const NAME = "let v: i32 = ...";
export const BODY = "    let v: i32 = fallible();\n    println!(\"{}\", v);";
export const CLAIMS_COMPILER_FORCES_HANDLING = true;
export const HOW = "Result<i32, String> is not i32, so extraction cannot be written without saying something about Err";
TMS/routes/explicit_discard.mjs
// Discard it on purpose. This is the row the entry exists for.
export const NAME = "let _ = ...";
export const BODY = "    let _ = fallible();";
export const CLAIMS_COMPILER_FORCES_HANDLING = false;
export const HOW = "binding to _ is the documented way to say 'I meant to ignore this'";
TMS/routes/match_arm.mjs
// The control. It names the Err arm and compiles clean with no warning.
//
// Without it, "let _ = ... compiles clean" would not be evidence of anything:
// it would be consistent with every route compiling clean.
export const NAME = "match { Ok, Err }";
export const BODY = "    let v = match fallible() { Ok(x) => x, Err(_) => 0 };\n    println!(\"{}\", v);";
export const CLAIMS_COMPILER_FORCES_HANDLING = false;
export const HOW = "the control - handling is written out, so nothing needs to be forced";
TMS/routes/unwrap.mjs
// Take the value and promise there is no error, at run time.
export const NAME = ".unwrap_or(0)";
export const BODY = "    println!(\"{}\", fallible().unwrap_or(0));";
export const CLAIMS_COMPILER_FORCES_HANDLING = false;
export const HOW = "the Err case is named, but by a method call rather than by the type checker";

DMS

DMS/report.mjs
// What a person is shown.
//
// `compiles` is never printed without the warning column beside it, because
// "it built" is the answer three different situations share here.
const pad = (value, width) => String(value).padEnd(width);

export function table(rows) {
  const lines = ["    route                compiles   must_use warning   error"];
  for (const row of rows) {
    lines.push(`    ${pad(row.route.NAME, 20)} ${pad(row.compiles ? "yes" : "NO", 10)} `
      + `${pad(row.mustUseWarning ? "yes" : row.denied ? "as an ERROR" : "-", 18)} `
      + `${row.errorCode ?? "-"}`);
  }
  return lines.join("\n");
}

export function boundary(discardPlain, discardStrict, assign) {
  return [
    "  the boundary, in two facts:",
    `    extraction is forced      - ${assign.route.NAME} does not compile (${assign.errorCode})`,
    `    discarding is not         - ${discardPlain.route.NAME} compiles, no warning`,
    `    and the loudest setting available does not change that: still `
      + `${discardStrict.compiles ? "compiles" : "refused"}`,
    "",
    "  So the type system forces the Err case to be NAMED wherever the value is used,",
    "  and forces nothing at all where the value is thrown away.",
  ].join("\n");
}

root

island_test.mjs
// The island test, run against the real compiler.
//
//   node src/island_test.mjs
//
// Section 2 checks the INSTRUMENT, because this entry's first version read only
// stdout, where cargo writes no diagnostics at all. It also measures the cache
// claim I wrote down beside that one and could not reproduce: a cached build
// replays its warnings, so the hazard I described does not exist.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";

import * as compiler from "./SMS/compiler.mjs";
import * as bareCall from "./TMS/routes/bare_call.mjs";
import * as directAssign from "./TMS/routes/direct_assign.mjs";
import * as explicitDiscard from "./TMS/routes/explicit_discard.mjs";
import * as matchArm from "./TMS/routes/match_arm.mjs";
import * as unwrap from "./TMS/routes/unwrap.mjs";

const here = path.dirname(fileURLToPath(import.meta.url));
const FMS = JSON.parse(fs.readFileSync(path.join(here, "FMS", "architecture.json"), "utf8"));
const POLICY = JSON.parse(fs.readFileSync(path.join(here, "SCL", "policy.json"), "utf8"));
const ROUTES = [bareCall, explicitDiscard, unwrap, directAssign, matchArm];
const failures = [];
let ran = 0;
const check = (label, ok, detail = "") => {
  ran += 1;
  process.stdout.write(`  ${ok ? "PASS" : "FAIL"}  ${label}${detail ? ` - ${detail}` : ""}\n`);
  if (!ok) failures.push(label);
};
const say = (line = "") => process.stdout.write(`${line}\n`);

if (!compiler.available()) {
  say("\n  REFUSED: no rust toolchain. This entry measures a compiler and will not guess.");
  process.exit(1);
}
say(`\n  ${compiler.versions()}`);

say("\n== 1. each route is an island, and FMS matches the tree");
for (const [unit, declared] of Object.entries(FMS.units)) {
  const dir = path.join(here, ...unit.split("/"));
  const onDisk = fs.readdirSync(dir).filter((n) => n.endsWith(".mjs")).sort();
  check(`${unit}: FMS declares what is on disk`,
    JSON.stringify(onDisk) === JSON.stringify([...declared].sort()),
    `disk ${onDisk.join(", ")} | FMS ${[...declared].sort().join(", ")}`);
  for (const file of onDisk) {
    const body = fs.readFileSync(path.join(dir, file), "utf8");
    check(`${unit}/${file} imports nothing at all`, !/^\s*import\s/m.test(body));
  }
}
check("every route states what it claims about the compiler",
  ROUTES.every((r) => typeof r.CLAIMS_COMPILER_FORCES_HANDLING === "boolean"));

say("\n== 2. the instrument, checked before anything is measured with it");
const first = compiler.build(bareCall.BODY);
check("a route known to warn does report the warning", first.mustUseWarning === true,
  "cargo writes diagnostics to stderr and exits 0 - reading only stdout loses every one");
check("and it did exit 0 while doing so", first.exitStatus === 0);
// Measured rather than assumed. I first wrote down a second instrument defect -
// that a cached unit would answer silently - and a mutation reinstating it
// stayed GREEN. This is what is actually true, and it is why that hazard does
// not exist here.
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "mssp-020-cache-"));
const fresh = compiler.buildIn(dir, bareCall.BODY, { name: "cacheprobe" });
const cached = compiler.rebuild(dir);   // same crate, source untouched
check("building the same directory twice really does hit the cache the second time",
  fresh.recompiled === true && cached.recompiled === false,
  `first ${fresh.recompiled ? "Compiling" : "Finished"}, second ${cached.recompiled ? "Compiling" : "Finished"}`);
check("and the cached build REPLAYS the warning rather than going quiet",
  cached.mustUseWarning === true,
  "so a shared package name is not a hazard here - the claim I first wrote down was wrong");
fs.rmSync(dir, { recursive: true, force: true });
check("a route known NOT to warn reports no warning",
  compiler.build(matchArm.BODY).mustUseWarning === false);
check("so the warning column can take both values", first.mustUseWarning !== compiler.build(matchArm.BODY).mustUseWarning);
const broken = compiler.build("    this is not rust;");
check("and a build that cannot compile is reported as such", broken.compiles === false);

say("\n== 3. the control - handling written out compiles clean");
const control = compiler.build(matchArm.BODY);
check("match names the Err arm and compiles", control.compiles === true);
check("with no must-use warning", control.mustUseWarning === false);
check("and no error code", control.errorCode === null);
const discard = compiler.build(explicitDiscard.BODY);
check("let _ = ... also compiles clean with no warning",
  discard.compiles === true && discard.mustUseWarning === false);
check("so 'compiles clean' is reached by handling AND by discarding",
  control.compiles === discard.compiles && control.mustUseWarning === discard.mustUseWarning,
  "which is why the control has to be here - without it, clean would be evidence of nothing");

say("\n== 4. extraction is forced, discarding is not");
const assign = compiler.build(directAssign.BODY);
check("using the T without naming Err does not compile", assign.compiles === false);
check("and the error is a type error, not a lint", assign.errorCode === "E0308", assign.errorCode ?? "-");
check("while dropping the whole value compiles", compiler.build(bareCall.BODY).compiles === true);
check("and discarding it explicitly compiles without even a warning",
  discard.compiles === true && discard.mustUseWarning === false);
const unwrapped = compiler.build(unwrap.BODY);
check("unwrap_or names Err by method call and compiles clean",
  unwrapped.compiles === true && unwrapped.mustUseWarning === false);

say("\n== 5. and the loudest setting the consumer has does not close it");
const denyBare = compiler.build(bareCall.BODY, { deny: true });
const denyDiscard = compiler.build(explicitDiscard.BODY, { deny: true });
check("deny(unused_must_use) turns the bare call into an error", denyBare.compiles === false);
check("and it names the lint, not a type", denyBare.denied === true && denyBare.errorCode === null);
check("but let _ = ... still compiles under the same setting", denyDiscard.compiles === true);
check("with nothing said about it at all",
  denyDiscard.mustUseWarning === false && denyDiscard.denied === false);
check("so the setting moves one row and not the other",
  denyBare.compiles !== compiler.build(bareCall.BODY).compiles
  && denyDiscard.compiles === discard.compiles);
check("which puts the decision back on the consumer - 改良點 16, inside a type system",
  POLICY.lint_setting === "deny(unused_must_use)");

say("\n== 6. the challenge - each route's claim against the compiler");
for (const route of ROUTES) {
  const result = compiler.challenge(route);
  check(`${route.NAME}: claims forced=${result.claimed}, compiler says ${result.forced}`,
    result.passed === true);
}
const liar = { NAME: "drill-liar", BODY: explicitDiscard.BODY, CLAIMS_COMPILER_FORCES_HANDLING: true };
const drilled = compiler.challenge(liar);
check("DRILL: a route claiming the compiler forces it, when it does not, is caught",
  drilled.passed === false);

say("\n== 7. what this does not settle");
check("#[must_use] is doing real work - the bare call is the one row that moves",
  first.mustUseWarning === true && discard.mustUseWarning === false);
check("SCL names the gap rather than implying coverage",
  POLICY.what_this_cannot_reach.includes("let _ = fallible()"));
check("and this entry measures one type in one language on one toolchain",
  FMS.non_goals.some((g) => /one toolchain|single language|other languages/i.test(g)),
  "the claim is demonstrated on rustc 1.96, not established for type systems in general");

compiler.cleanup();
say("");
if (failures.length > 0) {
  say(`  ${failures.length} FAILED: ${failures.join(" | ")}`);
  process.exitCode = 1;
} else {
  say(`  ${ran} checks passed - every row is a cargo build that really ran`);
}
main.mjs
// Five ways to meet a Result, and what the compiler does about each.
//
//   node src/main.mjs            the table, built by really running cargo
//   node src/main.mjs --strict   exit 1 if this deployment's lint setting has a gap
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

import * as report from "./DMS/report.mjs";
import * as compiler from "./SMS/compiler.mjs";
import * as bareCall from "./TMS/routes/bare_call.mjs";
import * as directAssign from "./TMS/routes/direct_assign.mjs";
import * as explicitDiscard from "./TMS/routes/explicit_discard.mjs";
import * as matchArm from "./TMS/routes/match_arm.mjs";
import * as unwrap from "./TMS/routes/unwrap.mjs";

const here = path.dirname(fileURLToPath(import.meta.url));
const POLICY = JSON.parse(fs.readFileSync(path.join(here, "SCL", "policy.json"), "utf8"));
export const ROUTES = [bareCall, explicitDiscard, unwrap, directAssign, matchArm];
const say = (line = "") => process.stdout.write(`${line}\n`);

function main(argv) {
  if (!compiler.available()) {
    say("\n  REFUSED: no rust toolchain on this machine. This entry measures a compiler and");
    say("  cannot be simulated - it reports nothing rather than reporting a guess.");
    return 1;
  }
  say(`\n  ${compiler.versions()}`);
  say(`  ${POLICY.deployment}: ${POLICY.lint_setting}\n`);

  const rows = ROUTES.map((route) => ({ route, ...compiler.build(route.BODY) }));
  say(report.table(rows));
  say("");
  say("  The control is the last row: handling written out, compiles clean, no warning.");
  say("  Without it, `let _ = ...` compiling clean would be consistent with everything");
  say("  compiling clean, and would be evidence of nothing.\n");

  const strict = ROUTES.map((route) => ({ route, ...compiler.build(route.BODY, { deny: true }) }));
  say(`  and with the consumer's own ${POLICY.lint_setting}:`);
  say(report.table(strict));
  say("");

  const discardPlain = rows.find((r) => r.route === explicitDiscard);
  const discardStrict = strict.find((r) => r.route === explicitDiscard);
  const assignRow = rows.find((r) => r.route === directAssign);
  say(report.boundary(discardPlain, discardStrict, assignRow));

  const gap = discardStrict.compiles === true;
  if (argv.includes("--strict") && gap) {
    say(`\n  --strict: ${POLICY.what_this_cannot_reach}`);
    compiler.cleanup();
    return 1;
  }
  compiler.cleanup();
  return 0;
}

process.exitCode = main(process.argv.slice(2));