Skip to content

chore(lint): enable clippy::unreachable - #42

Merged
tupe12334 merged 3 commits into
mainfrom
clippy/enable-unreachable
Jul 16, 2026
Merged

tupe12334 merged 3 commits into
mainfrom
clippy/enable-unreachable

Conversation

@tupe12334

Copy link
Copy Markdown
Member

What

Enable the clippy::unreachable restriction lint at deny in the [lints.clippy] table.

Why

unreachable!() panics at runtime if its "impossible" branch is ever reached (a broken invariant aborts the consuming process). As a no-panic storage engine, mdstore already denies every other panicking escape hatch — panic, todo, unwrap_used, expect_used, panic_in_result_fn, unwrap_in_result. This closes the last gap so unexpected states must be surfaced as recoverable Err values, enforced by CI.

Change

One line added to Cargo.toml:

unreachable = "deny"

Impact / verification

The codebase has zero uses of unreachable!(), so no source changes were needed — this is a forward-looking guardrail. Locally on Rust 1.96.0:

  • cargo clippy --all-targets — clean (exit 0)
  • cargo build — ok
  • cargo test — 113 passed, 0 failed

Closes #41


This pull request was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim. cc @tupe12334

tupe12334 and others added 3 commits June 19, 2026 20:08
Deny the `unreachable!()` macro via the `[lints.clippy]` table. It is a
runtime panic in disguise: reaching the "impossible" branch aborts the
consuming process, which a no-panic storage engine must never do.

This completes the set of panicking-macro denials already in place
(panic, todo, unwrap_used, expect_used, panic_in_result_fn). The
codebase has zero `unreachable!()` uses today, so this surfaces no new
violations; clippy, build, and the full test suite (113 tests) pass.

Closes #41

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…config conflict

Resolved by the "Resolve conflicts on code-quality PRs (non-guiddeco)" routine of moadim.
Resolve Cargo.toml conflict: the unreachable=deny lint from this PR
was independently added to main via #57 in the interim. Dedupe to a
single entry (keeping main's wording) and keep main's map_err_ignore
entry that landed alongside it.
@tupe12334
tupe12334 merged commit 4415d81 into main Jul 16, 2026
6 checks passed
@tupe12334
tupe12334 deleted the clippy/enable-unreachable branch July 16, 2026 17:07
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.

Enable clippy::unreachable lint

1 participant