Forbid unsafe across all crates and document 100% safe Rust#129
Merged
Conversation
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.
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.
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 forbidsunsafe, matching the core crate. The guarantee is compiler-enforced through the existing clippy and check steps (which build--workspace --all-targets --all-featuresand--no-default-features), so no separate CI gate is added: a strayunsafeblock 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
unsafeexists 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
raising the MSRV - a minor version bump pre-1.0)
Checklist
just checkpasses: rustfmt, clippy, andcargo checkwith all features and with--no-default-features)-D warnings)just test)# Examplesdoctest, and user-facing changes are reflected inexamples/where applicable