Repository navigation
chore(lint): enable clippy::unreachable - #42
Merged
Merged
Conversation
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.
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.
What
Enable the
clippy::unreachablerestriction lint atdenyin 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,mdstorealready 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 recoverableErrvalues, enforced by CI.Change
One line added to
Cargo.toml: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— okcargo test— 113 passed, 0 failedCloses #41
This pull request was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim. cc @tupe12334