Skip to content

Commit 13fc233

Browse files
hyperpolymathclaude
andcommitted
chore: add #![forbid(unsafe_code)] to safe Rust crates
Adds the forbid(unsafe_code) crate-level attribute to all Rust crates that do not use unsafe code, hardening the safety guarantee at compile time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 45a5893 commit 13fc233

File tree

7 files changed

+7
-0
lines changed
  • opm-canonicalizer/src
  • rescript-ecosystem/packages
  • well-known-ecosystem/validator/src

7 files changed

+7
-0
lines changed

opm-canonicalizer/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![forbid(unsafe_code)]
12
use serde::de::{self, Deserialize, Deserializer, MapAccess, SeqAccess, Visitor};
23
use std::collections::BTreeMap;
34
use std::fmt;

rescript-ecosystem/packages/bindings/grpc/codec/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//! - WASM returns base64-encoded protobuf binary
1010
//! - For decoding, WASM receives base64 binary and returns JSON
1111
12+
#![forbid(unsafe_code)]
1213
use integer_encoding::{VarInt, VarIntWriter};
1314
use serde_json::{Map, Value};
1415
use std::io::Write;

rescript-ecosystem/packages/bindings/grpc/protoc-gen-rescript/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! CodeGeneratorResponse to stdout, generating ReScript types and
66
//! optional WASM codec bindings.
77
8+
#![forbid(unsafe_code)]
89
use std::io::{self, Read, Write};
910

1011
use anyhow::{Context, Result};

rescript-ecosystem/packages/bindings/openapi/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! This library provides the core functionality for parsing OpenAPI specs
77
//! and generating ReScript code including types, validators, and HTTP clients.
88
9+
#![forbid(unsafe_code)]
910
pub mod codegen;
1011
pub mod ir;
1112
pub mod parser;

rescript-ecosystem/packages/bindings/tauri/examples/opsm-shell/src-tauri/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// main.rs - Rust backend for OPSM shell example
55

66
#![cfg_attr(
7+
#![forbid(unsafe_code)]
78
all(not(debug_assertions), target_os = "windows"),
89
windows_subsystem = "windows"
910
)]

rescript-ecosystem/packages/core/compiler-source/rewatch/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![forbid(unsafe_code)]
12
pub mod build;
23
pub mod cli;
34
pub mod cmd;

well-known-ecosystem/validator/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//!
66
//! Validates well-known resources against RFC standards and best practices.
77
8+
#![forbid(unsafe_code)]
89
mod contract;
910
mod registry;
1011
mod rules;

0 commit comments

Comments
 (0)