Skip to content

chore(lint): an exception to the unsafe ban is an #[expect] with a reason - #712

Draft
PiquelChips wants to merge 1 commit into
mainfrom
chore/unsafe-code-warn
Draft

PiquelChips wants to merge 1 commit into
mainfrom
chore/unsafe-code-warn

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

What and why

unsafe_code was forbid, which no #[expect] can lift. It is now warn like every other workspace lint, and -D warnings in lint and CI makes it an error. Code that must use unsafe can say why on the smallest item with #[expect(unsafe_code, reason = "...")].

The workspace has no unsafe, so no site changes. The Rust conventions page describes the new rule.

Testing

cargo clippy --workspace --all-targets -- -D warnings passes.

Note

Written by Claude Sonnet 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant