Skip to content

Forbid unsafe across all crates and document 100% safe Rust#129

Merged
powersemmi merged 1 commit into
mainfrom
feat/forbid-unsafe
Jul 3, 2026
Merged

Forbid unsafe across all crates and document 100% safe Rust#129
powersemmi merged 1 commit into
mainfrom
feat/forbid-unsafe

Conversation

@powersemmi

Copy link
Copy Markdown
Owner

Description

Add #![forbid(unsafe_code)] to the proc-macro crate (ruststream-macros) and the CLI binary crate root (src/bin/ruststream/main.rs), so every crate in the workspace forbids unsafe, matching the core crate. The guarantee is compiler-enforced through the existing clippy and check steps (which build --workspace --all-targets --all-features and --no-default-features), so no separate CI gate is added: a stray unsafe block fails the build.

State the guarantee in the README with a "100% safe Rust" badge and a one-line note, so the property is visible to users.

No unsafe exists in the source today, so this is enforcement and documentation, not a refactor. Additive; no API or behavior change. Follows sqlx's stance of enforcing #![forbid(unsafe_code)] across all crates.

Fixes #128

Type of change

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (removing or renaming public API, changing a signature, tightening bounds, or
    raising the MSRV - a minor version bump pre-1.0)
  • This change requires a documentation update

Checklist

  • My code follows the project's style guidelines (just check passes: rustfmt, clippy, and
    cargo check with all features and with --no-default-features)
  • I have performed a self-review of my own code
  • I have made the necessary changes to the documentation (rustdoc and/or the docs site)
  • My changes generate no new warnings (clippy runs with -D warnings)
  • I have added tests that validate my fix or new feature
  • New and existing tests pass locally (just test)
  • Public items carry a compiling # Examples doctest, and user-facing changes are reflected in
    examples/ where applicable

Add `#![forbid(unsafe_code)]` to the proc-macro crate and the CLI binary
crate root, so every crate in the workspace forbids `unsafe`, matching the
core crate. The guarantee is compiler-enforced through the existing clippy
and check steps (which build `--workspace --all-targets --all-features` and
`--no-default-features`), so no separate CI gate is added: a stray `unsafe`
block fails the build.

State the guarantee in the README with a "100% safe Rust" badge and a
one-line note, so the property is visible to users.

No `unsafe` exists in the source today, so this is enforcement and
documentation, not a refactor. Additive; no API or behavior change. Follows
sqlx's stance of enforcing `#![forbid(unsafe_code)]` across all crates.
@powersemmi powersemmi self-assigned this Jul 3, 2026
@powersemmi powersemmi added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 3, 2026
@powersemmi powersemmi merged commit 7a19edf into main Jul 3, 2026
22 checks passed
@powersemmi powersemmi deleted the feat/forbid-unsafe branch July 3, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce #![forbid(unsafe_code)] across all crates and document 100% safe Rust in README

1 participant