From 10bf6af05ec8c3d9b4de6312ccad0e0354e61cda Mon Sep 17 00:00:00 2001 From: Mark Karpeles Date: Thu, 4 Jun 2026 22:24:32 +0900 Subject: [PATCH] Forbid unsafe code across all package targets Add [lints.rust] unsafe_code = "forbid" to Cargo.toml so the guarantee extends beyond the library (which already had #![forbid(unsafe_code)] in src/lib.rs) to the build-time code generator, build_support helpers, examples, and tests. Co-Authored-By: Claude Opus 4.8 (1M context) --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 0536111..b9b3385 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,13 @@ categories = ["no-std", "cryptography", "embedded"] # Ship the roots + generators, but not throwaway artifacts. exclude = ["/.github", "/*.txt"] +# Forbid unsafe across every target in the package (lib, build script, +# examples, tests). The library also carries #![forbid(unsafe_code)] in +# src/lib.rs; this extends the same guarantee to the build-time code generator +# and the maintenance tooling. +[lints.rust] +unsafe_code = "forbid" + [lib] path = "src/lib.rs"